MenuAddConditionalTest.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. using Newtonsoft.Json;
  7. using FrameworkCoreTest;
  8. namespace JCSoft.WX.FrameworkTest.Api
  9. {
  10. public class MenuAddConditionalTest : MockPostApiBaseTest<MenuAddConditionalRequest,MenuAddConditionalResponse>
  11. {
  12. public MenuAddConditionalTest()
  13. {
  14. }
  15. protected override string GetReturnResult(bool errResult)
  16. {
  17. if (errResult) return s_errmsg;
  18. return @"
  19. {
  20. ""menuid"":""208379533""
  21. }";
  22. }
  23. protected override MenuAddConditionalRequest InitRequestObject()
  24. {
  25. return JsonConvert.DeserializeObject<MenuAddConditionalRequest>(@"{
  26. ""button"":[
  27. {
  28. ""type"":""click"",
  29. ""name"":""今日歌曲"",
  30. ""key"":""V1001_TODAY_MUSIC""
  31. },
  32. {
  33. ""name"":""菜单"",
  34. ""sub_button"":[
  35. {
  36. ""type"":""view"",
  37. ""name"":""搜索"",
  38. ""url"":""http://www.soso.com/""
  39. },
  40. {
  41. ""type"":""miniprogram"",
  42. ""name"":""wxa"",
  43. ""url"":""http://mp.weixin.qq.com"",
  44. ""appid"":""wx286b93c14bbf93aa"",
  45. ""pagepath"":""pages/lunar/index""
  46. },
  47. {
  48. ""type"":""click"",
  49. ""name"":""赞一下我们"",
  50. ""key"":""V1001_GOOD""
  51. }]
  52. }],
  53. ""matchrule"":{
  54. ""tag_id"":""2"",
  55. ""sex"":""1"",
  56. ""country"":""中国"",
  57. ""province"":""广东"",
  58. ""city"":""广州"",
  59. ""client_platform_type"":""2"",
  60. ""language"":""zh_CN""
  61. }
  62. }");
  63. }
  64. }
  65. }