CustomserviceKfsessionCreateTest.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 CustomserviceKfsessionCreateTest : MockPostApiBaseTest<CustomserviceKfsessionCreateRequest, CustomserviceKfsessionCreateResponse>
  12. {
  13. protected override CustomserviceKfsessionCreateRequest InitRequestObject()
  14. {
  15. return new CustomserviceKfsessionCreateRequest
  16. {
  17. AccessToken = "123",
  18. KfAccount = "kf@kf.com",
  19. OpenId = "123lkjzcv",
  20. Text = "this is test text"
  21. };
  22. }
  23. protected override string GetReturnResult(bool errResult)
  24. {
  25. if (errResult) return s_errmsg;
  26. return @"{
  27. ""kf_account"" : ""test1@test"",
  28. ""openid"" : ""OPENID"",
  29. ""text"" : ""这是一段附加信息""
  30. }";
  31. }
  32. public override CustomserviceKfsessionCreateResponse GetResponse()
  33. {
  34. return mock_client.Object.Execute(Request);
  35. }
  36. }
  37. }