mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 18:22:24 +08:00
test(wxapi): 适配新的模型测试
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests
|
||||
{
|
||||
public class WechatApiExecuteCgibinTests
|
||||
{
|
||||
[Fact(DisplayName = "[GET] /cgi-bin/token")]
|
||||
public async Task CgibinTokenTest()
|
||||
{
|
||||
var request = new Models.CgibinTokenRequest();
|
||||
var response = await TestClients.Instance.ExecuteCgibinTokenAsync(request);
|
||||
|
||||
Assert.NotNull(response.AccessToken);
|
||||
}
|
||||
|
||||
[Fact(DisplayName = "[GET] /cgi-bin/ticket/getticket")]
|
||||
public async Task CgibinTicketGetTicketTest()
|
||||
{
|
||||
var request = new Models.CgibinTicketGetTicketRequest()
|
||||
{
|
||||
AccessToken = TestConfigs.WechatAccessToken
|
||||
};
|
||||
var response = await TestClients.Instance.ExecuteCgibinTicketGetTicketAsync(request);
|
||||
|
||||
Assert.NotNull(response.Ticket);
|
||||
}
|
||||
|
||||
[Fact(DisplayName = "[GET] /cgi-bin/getcallbackip")]
|
||||
public async Task CgibinGetCallbackIpTest()
|
||||
{
|
||||
var request = new Models.CgibinGetCallbackIpRequest()
|
||||
{
|
||||
AccessToken = TestConfigs.WechatAccessToken
|
||||
};
|
||||
var response = await TestClients.Instance.ExecuteCgibinGetCallbackIpAsync(request);
|
||||
|
||||
Assert.NotEmpty(response.IPList);
|
||||
}
|
||||
|
||||
[Fact(DisplayName = "[GET] /cgi-bin/get_api_domain_ip")]
|
||||
public async Task CgibinGetApiDomainIpTest()
|
||||
{
|
||||
var request = new Models.CgibinGetApiDomainIpRequest()
|
||||
{
|
||||
AccessToken = TestConfigs.WechatAccessToken
|
||||
};
|
||||
var response = await TestClients.Instance.ExecuteCgibinGetApiDomainIpAsync(request);
|
||||
|
||||
Assert.NotEmpty(response.IPList);
|
||||
}
|
||||
|
||||
[Fact(DisplayName = "[POST] /cgi-bin/clear_quota")]
|
||||
public async Task CgibinClearQuotaTest()
|
||||
{
|
||||
var request = new Models.CgibinClearQuotaRequest()
|
||||
{
|
||||
AccessToken = TestConfigs.WechatAccessToken
|
||||
};
|
||||
var response = await TestClients.Instance.ExecuteCgibinClearQuotaAsync(request);
|
||||
|
||||
Assert.True(response.IsSuccessful());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user