CustomeServiceGetRecordTest.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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
  10. {
  11. public class CustomeServiceGetRecordTest : MockPostApiBaseTest<CustomServiceGetRecordRequest, CustomServiceGetRecordResponse>
  12. {
  13. protected override CustomServiceGetRecordRequest InitRequestObject()
  14. {
  15. return new CustomServiceGetRecordRequest
  16. {
  17. StartTime = new DateTime(2014,1,1),
  18. EndTime = new DateTime(2014,3,1),
  19. AccessToken = "123",
  20. OpenId = "123",
  21. PageIndex = 1,
  22. PageSize = 10
  23. };
  24. }
  25. protected override string GetReturnResult(bool errResult)
  26. {
  27. if (errResult)
  28. {
  29. return "{\"errcode\":40029,\"errmsg\":\"invalid code\"}";
  30. }
  31. return @"{
  32. ""recordlist"": [
  33. {
  34. ""worker"": "" test1"",
  35. ""openid"": ""oDF3iY9WMaswOPWjCIp_f3Bnpljk"",
  36. ""opercode"": 2002,
  37. ""time"": 1400563710,
  38. ""text"": "" 您好,客服test1为您服务。""
  39. },
  40. {
  41. ""worker"": "" test1"",
  42. ""openid"": ""oDF3iY9WMaswOPWjCIp_f3Bnpljk"",
  43. ""opercode"": 2003,
  44. ""time"": 1400563731,
  45. ""text"": "" 你好,有什么事情? ""
  46. },
  47. ]
  48. }";
  49. }
  50. }
  51. }