You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

GuildHandlers.cs 1.8 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using Newtonsoft.Json;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Net;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace Discord.Tests.Framework.Responses.Guilds
  10. {
  11. public static class GuildHandlers
  12. {
  13. public static string Id_Valid(string method, string json)
  14. {
  15. Assert.AreEqual("GET", method, "Expected method to '/guilds/:id' is GET.");
  16. return Json.SerializeObject(Guild_Mocks.Guild_From_Id);
  17. }
  18. public static string Id_Invalid(string method, string json)
  19. {
  20. Assert.AreEqual("GET", method, "Expected method to '/guilds/:id' is GET.");
  21. throw new Net.HttpException((HttpStatusCode)404);
  22. }
  23. public static string Bans_Valid(string method, string json)
  24. {
  25. Assert.AreEqual("GET", method, "Expected method to '/guilds/:id/bans' is GET.");
  26. return Json.SerializeObject(Guild_Mocks.GuildBansList);
  27. }
  28. public static string Members_Valid(string method, string json)
  29. {
  30. Assert.AreEqual("GET", method, "Expected method to '/guilds/:id/members' is GET.");
  31. return Json.SerializeObject(Member_Mocks.Guild_Members);
  32. }
  33. public static string Member_Valid(string method, string json)
  34. {
  35. Assert.AreEqual("GET", method, "Expected method to '/guilds/:id/members/:member_id' is GET.");
  36. return Json.SerializeObject(Member_Mocks.Guild_Member_1);
  37. }
  38. public static string Member_Invalid(string method, string json)
  39. {
  40. Assert.AreEqual("GET", method, "Expected method to '/guilds/:id/members/:member_id' is GET.");
  41. throw new Net.HttpException((HttpStatusCode)404);
  42. }
  43. }
  44. }