CustomserviceKfsessionGetsessionTest.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 CustomserviceKfsessionGetsessionTest : MockPostApiBaseTest<CustomserviceKfsessionGetsessionRequest, CustomserviceKfsessionGetsessionResponse>
  12. {
  13. protected override CustomserviceKfsessionGetsessionRequest InitRequestObject()
  14. {
  15. return new CustomserviceKfsessionGetsessionRequest
  16. {
  17. AccessToken = "123",
  18. OpenId = "openid"
  19. };
  20. }
  21. protected override string GetReturnResult(bool errResult)
  22. {
  23. if (errResult) return s_errmsg;
  24. return @"{
  25. ""createtime"" : 123456789,
  26. ""errcode"" : 0,
  27. ""errmsg"" : ""ok"",
  28. ""kf_account"" : ""test1@test""
  29. }";
  30. }
  31. public override CustomserviceKfsessionGetsessionResponse GetResponse()
  32. {
  33. return mock_client.Object.Execute(Request);
  34. }
  35. }
  36. }