feat(tenpayv3): 升级公共组件

This commit is contained in:
Fu Diwei
2022-01-21 13:10:56 +08:00
parent 3656eb176f
commit b442a3d618
48 changed files with 304 additions and 569 deletions

View File

@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
{
public class TestCase_ApiExecuteExecuteBillTests
{
[Fact(DisplayName = "测试用例:调用 API [GET] /bill/tradebill")]
public async Task TestExecuteGetBillTradeBill()
{
var request = new Models.GetBillTradeBillRequest()
{
BillDateString = "2021-04-05"
};
var response = await TestClients.Instance.ExecuteGetBillTradeBillAsync(request);
Assert.True(response.IsSuccessful());
Assert.NotNull(response.HashType);
Assert.NotNull(response.HashValue);
Assert.NotNull(response.DownloadUrl);
}
[Fact(DisplayName = "测试用例:调用 API [GET] /bill/fundflowbill")]
public async Task TestExecuteGetBillFundflowBill()
{
var request = new Models.GetBillFundflowBillRequest()
{
BillDateString = DateTimeOffset.Now.AddDays(-1).ToString("yyyy-MM-dd")
};
var response = await TestClients.Instance.ExecuteGetBillFundflowBillAsync(request);
Assert.True(response.IsSuccessful());
Assert.NotNull(response.HashType);
Assert.NotNull(response.HashValue);
Assert.NotNull(response.DownloadUrl);
}
[Fact(DisplayName = "测试用例:调用 API [GET] /billdownload/file")]
public async Task TestExecuteDownloadBillFile()
{
var request = new Models.DownloadBillFileRequest()
{
DownloadUrl = "https://api.mch.weixin.qq.com/v3/billdownload/file?token=FAKE_TOKEN"
};
var response = await TestClients.Instance.ExecuteDownloadBillFileAsync(request);
Assert.True(response.IsSuccessful());
Assert.NotEmpty(response.RawBytes);
}
}
}