Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
Close Stale Issues / close_stale_issues (push) Has been cancelled
repo-sync / repo-sync (push) Has been cancelled
auto-deploy-tencent-scf / pre-check (push) Has been cancelled
auto-deploy-tencent-scf / deploy serverless (push) Has been cancelled
39 lines
1013 B
C#
39 lines
1013 B
C#
using FluentAssertions;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Ray.BiliBiliTool.Agent.BiliBiliAgent.Dtos;
|
|
using Ray.BiliBiliTool.Agent.BiliBiliAgent.Interfaces;
|
|
using Ray.BiliBiliTool.Console;
|
|
|
|
namespace Ray.BiliBiliTool.Agent.FunctionalTests;
|
|
|
|
public class AccountApiTests
|
|
{
|
|
private readonly IAccountApi _api;
|
|
|
|
public AccountApiTests()
|
|
{
|
|
var envs = new List<string>
|
|
{
|
|
"--ENVIRONMENT=Development",
|
|
//"HTTP_PROXY=localhost:8888",
|
|
//"HTTPS_PROXY=localhost:8888"
|
|
};
|
|
IHost host = Program.CreateHost(envs.ToArray());
|
|
_api = host.Services.GetRequiredService<IAccountApi>();
|
|
}
|
|
|
|
[Fact]
|
|
public async Task GetCoinBalance_Normal_GetCoinBalance()
|
|
{
|
|
// Act
|
|
BiliApiResponse<CoinBalance> re = await _api.GetCoinBalanceAsync(null);
|
|
|
|
// Arrange
|
|
|
|
// Assert
|
|
re.Code.Should().Be(0);
|
|
re.Data.Money.Should().NotBeNull();
|
|
}
|
|
}
|