pull file
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

This commit is contained in:
2026-02-11 23:32:56 +08:00
commit e519cac94e
656 changed files with 45058 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Ray.BiliBiliTool.Agent.BiliBiliAgent.Dtos;
using Ray.BiliBiliTool.Agent.BiliBiliAgent.Dtos.ViewMall;
using Ray.BiliBiliTool.Agent.BiliBiliAgent.Interfaces;
using Ray.BiliBiliTool.Console;
namespace Ray.BiliBiliTool.Agent.FunctionalTests;
public class VipMallApiTests
{
private readonly IVipMallApi _api;
private readonly BiliCookie _ck;
public VipMallApiTests()
{
var envs = new List<string>
{
"--ENVIRONMENT=Development",
//"HTTP_PROXY=localhost:8888",
//"HTTPS_PROXY=localhost:8888"
};
IHost host = Program.CreateHost(envs.ToArray());
_ck = host.Services.GetRequiredService<BiliCookie>();
_api = host.Services.GetRequiredService<IVipMallApi>();
}
[Fact]
public async Task ViewVipMallAsync_Normal_Success()
{
// Arrange
var req = new ViewVipMallRequest() { Csrf = _ck.BiliJct };
// Act
BiliApiResponse re = await _api.ViewVipMallAsync(req, null);
// Assert
re.Code.Should().Be(0);
re.Message.Should().BeEquivalentTo("SUCCESS");
}
}