1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using JCSoft.WX.Framework.Models.ApiRequests;
- using JCSoft.WX.Framework.Models.ApiResponses;
- using Xunit;
- namespace FrameworkCoreTest
- {
- public class MockGetcallbackipTestTest : MockPostApiBaseTest<GetcallbackipRequest, GetcallbackipResponse>
- {
- [Fact]
- public void MockCallbackiptest()
- {
- MockSetup(false);
- var response = mock_client.Object.Execute(Request);
- Assert.Equal(2, response.IPList.Count());
- foreach (var ip in response.IPList)
- {
- Console.WriteLine(ip);
- }
- }
- protected override GetcallbackipRequest InitRequestObject()
- {
- return new GetcallbackipRequest()
- {
- AccessToken = "123"
- };
- }
- protected override string GetReturnResult(bool errResult)
- {
- if (errResult) return s_errmsg;
- return "{\"ip_list\":[\"127.0.0.1\",\"127.0.0.1\"]}";
- }
- }
- }
|