2021-05-28 19:27:38 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests
|
|
|
|
|
{
|
2022-01-21 16:57:42 +08:00
|
|
|
|
public class TestCase_ApiExecuteWxaApiTests
|
2021-05-28 19:27:38 +08:00
|
|
|
|
{
|
2022-01-21 16:57:42 +08:00
|
|
|
|
[Fact(DisplayName = "测试用例:调用 API [POST] /wxaapi/log/jserr_list")]
|
|
|
|
|
public async Task TestExecuteWxaApiLogGetPerformance()
|
2021-05-28 19:27:38 +08:00
|
|
|
|
{
|
|
|
|
|
var request = new Models.WxaApiLogGetPerformanceRequest()
|
|
|
|
|
{
|
|
|
|
|
AccessToken = TestConfigs.WechatAccessToken,
|
|
|
|
|
CostTimeType = 1,
|
|
|
|
|
StartTimestamp = DateTimeOffset.Parse("2021-01-01").ToUnixTimeSeconds(),
|
|
|
|
|
EndTimestamp = DateTimeOffset.Parse("2021-01-31").ToUnixTimeSeconds()
|
|
|
|
|
};
|
|
|
|
|
var response = await TestClients.Instance.ExecuteWxaApiLogGetPerformanceAsync(request);
|
|
|
|
|
|
|
|
|
|
Assert.True(response.IsSuccessful());
|
|
|
|
|
Assert.NotNull(response.DefaultTimeData);
|
|
|
|
|
Assert.NotEmpty(response.DefaultTimeData.DataList);
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-21 16:57:42 +08:00
|
|
|
|
[Fact(DisplayName = "测试用例:调用 API [GET] /wxaapi/log/get_scene")]
|
|
|
|
|
public async Task TestExecuteWxaApiLogGetScene()
|
2021-05-28 19:27:38 +08:00
|
|
|
|
{
|
|
|
|
|
var request = new Models.WxaApiLogGetSceneRequest()
|
|
|
|
|
{
|
|
|
|
|
AccessToken = TestConfigs.WechatAccessToken
|
|
|
|
|
};
|
|
|
|
|
var response = await TestClients.Instance.ExecuteWxaApiLogGetSceneAsync(request);
|
|
|
|
|
|
|
|
|
|
Assert.True(response.IsSuccessful());
|
|
|
|
|
Assert.NotEmpty(response.SceneDataList);
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-21 16:57:42 +08:00
|
|
|
|
[Fact(DisplayName = "测试用例:调用 API [GET] /wxaapi/log/get_client_version")]
|
|
|
|
|
public async Task TestExecuteWxaApiLogGetClientVersion()
|
2021-05-28 19:27:38 +08:00
|
|
|
|
{
|
|
|
|
|
var request = new Models.WxaApiLogGetClientVersionRequest()
|
|
|
|
|
{
|
|
|
|
|
AccessToken = TestConfigs.WechatAccessToken
|
|
|
|
|
};
|
|
|
|
|
var response = await TestClients.Instance.ExecuteWxaApiLogGetClientVersionAsync(request);
|
|
|
|
|
|
|
|
|
|
Assert.True(response.IsSuccessful());
|
|
|
|
|
Assert.NotEmpty(response.ClientVersionDataList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|