12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using FrameworkCoreTest;
- using JCSoft.WX.Framework.Models.ApiRequests;
- using JCSoft.WX.Framework.Models.ApiResponses;
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Xunit;
- namespace JCSoft.WX.FrameworkTest.Api
- {
- public class MenuDelconditionalTest : MockPostApiBaseTest<MenuDelconditionalRequest, MenuDelconditionalResponse>
- {
- [Fact]
- public void Success()
- {
- MockSetup(false);
- var response = mock_client.Object.Execute(Request);
- Assert.False(response.IsError);
- }
- [Fact]
- public void Error()
- {
- MockSetup(true);
- var response = mock_client.Object.Execute(Request);
- Assert.Equal(true, response.IsError);
- //Console.WriteLine(response);
- }
- protected override string GetReturnResult(bool errResult)
- {
- if (errResult)
- {
- return "{\"errcode\":40029,\"errmsg\":\"invalid code\"}";
- }
- return "{\"errcode\":0,\"errmsg\":\"ok\"}";
- }
- protected override MenuDelconditionalRequest InitRequestObject()
- {
- return new MenuDelconditionalRequest
- {
- AccessToken = "123",
- MenuId = "123123"
- };
- }
- }
-
- }
|