MenuTrymatchTest.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using JCSoft.WX.Framework.Models.ApiResponses;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using JCSoft.WX.Framework.Models.ApiRequests;
  6. namespace JCSoft.WX.FrameworkTest.Api
  7. {
  8. public class MenuTrymatchTest : MockApiBaseTest<MenuTrymatchRequest, MenuTrymatchResponse>
  9. {
  10. protected override string GetReturnResult(bool errResult)
  11. {
  12. if(errResult)
  13. return "{\"errcode\":40029,\"errmsg\":\"invalid code\"}";
  14. return @"{
  15. ""button"": [
  16. {
  17. ""type"": ""view"",
  18. ""name"": ""tx"",
  19. ""url"": ""http://www.qq.com/"",
  20. ""sub_button"": [ ]
  21. },
  22. {
  23. ""type"": ""view"",
  24. ""name"": ""tx"",
  25. ""url"": ""http://www.qq.com/"",
  26. ""sub_button"": [ ]
  27. },
  28. {
  29. ""type"": ""view"",
  30. ""name"": ""tx"",
  31. ""url"": ""http://www.qq.com/"",
  32. ""sub_button"": [ ]
  33. }
  34. ]
  35. }";
  36. }
  37. protected override MenuTrymatchRequest InitRequestObject()
  38. {
  39. return new MenuTrymatchRequest
  40. {
  41. AccessToken = "123",
  42. UserId = "weixin"
  43. };
  44. }
  45. }
  46. }