DatacubeGetInterfaceTest.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 DatacubeGetInterfaceTest : MockPostApiBaseTest<DatacubeGetInterfaceSummaryHourRequest, DatacubeGetInterfaceResponse>
  12. {
  13. protected override DatacubeGetInterfaceSummaryHourRequest InitRequestObject()
  14. {
  15. return new DatacubeGetInterfaceSummaryHourRequest
  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-01"",
  29. ""ref_hour"": 0,
  30. ""callback_count"": 331,
  31. ""fail_count"": 18,
  32. ""total_time_cost"": 167870,
  33. ""max_time_cost"": 5042
  34. }
  35. //后续还有不同ref_hour的数据
  36. ]
  37. }";
  38. }
  39. public override DatacubeGetInterfaceResponse GetResponse()
  40. {
  41. return mock_client.Object.Execute(Request);
  42. }
  43. }
  44. }