DAtacubeGetarticletotalTest.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using JCSoft.WX.Framework.Models.ApiRequests;
  7. using JCSoft.WX.Framework.Models.ApiResponses;
  8. using Xunit;
  9. namespace FrameworkCoreTest.Api
  10. {
  11. public class DatacubeGetarticletotalTest : MockPostApiBaseTest<DatacubeGetarticletotalRequest, DatacubeGetArticlesResponse>
  12. {
  13. protected override DatacubeGetarticletotalRequest InitRequestObject()
  14. {
  15. return new DatacubeGetarticletotalRequest
  16. {
  17. AccessToken = "123",
  18. BeginDate = "2015-04-01",
  19. EndDate = "2015-04-16"
  20. };
  21. }
  22. public override DatacubeGetArticlesResponse GetResponse()
  23. {
  24. return mock_client.Object.Execute(Request);
  25. }
  26. protected override string GetReturnResult(bool errResult)
  27. {
  28. if (errResult) return s_errmsg;
  29. return @"{
  30. ""list"": [
  31. {
  32. ""ref_date"": ""2014-12-14"",
  33. ""msgid"": ""202457380_1"",
  34. ""title"": ""马航丢画记"",
  35. ""details"": [
  36. {
  37. ""stat_date"": ""2014-12-14"",
  38. ""target_user"": 261917,
  39. ""int_page_read_user"": 23676,
  40. ""int_page_read_count"": 25615,
  41. ""ori_page_read_user"": 29,
  42. ""ori_page_read_count"": 34,
  43. ""share_user"": 122,
  44. ""share_count"": 994,
  45. ""add_to_fav_user"": 1,
  46. ""add_to_fav_count"": 3
  47. },
  48. //后续还会列出所有stat_date符合“ref_date(群发的日期)到接口调用日期”(但最多只统计7天)的数据
  49. ]
  50. },
  51. //后续还有ref_date(群发的日期)在begin_date和end_date之间的群发文章的数据
  52. ]
  53. }";
  54. }
  55. }
  56. }