DatacubeGetUpStreamMsgTest.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 DatacubeGetUpStreamMsgTest : MockPostApiBaseTest<DatacubeGetUpStreamMsgRequest,DatacubeGetStreamMsgResponse>
  12. {
  13. protected override DatacubeGetUpStreamMsgRequest InitRequestObject()
  14. {
  15. return new DatacubeGetUpStreamMsgRequest
  16. {
  17. AccessToken = "123",
  18. BeginDate = "2015-04-12",
  19. EndDate = "2015-04-13"
  20. };
  21. }
  22. protected override string GetReturnResult(bool errResult)
  23. {
  24. if (errResult) return s_errmsg;
  25. return @"{
  26. ""list"": [
  27. {
  28. ""ref_date"": ""2014-12-07"",
  29. ""msg_type"": 1,
  30. ""msg_user"": 282,
  31. ""msg_count"": 817
  32. }
  33. //后续还有同一ref_date的不同msg_type的数据,以及不同ref_date(在时间范围内)的数据
  34. ]
  35. }";
  36. }
  37. public override DatacubeGetStreamMsgResponse GetResponse()
  38. {
  39. return mock_client.Object.Execute(Request);
  40. }
  41. }
  42. }