nsnail 6fbb519256
refactor: ♻️ projectUsings (#183)
Co-authored-by: tk <fiyne1a@dingtalk.com>
2024-10-30 16:20:18 +08:00

31 lines
1019 B
C#

using NetAdmin.Domain.Dto.Sys.Captcha;
namespace NetAdmin.SysComponent.Tests.Sys;
/// <summary>
/// 人机验证测试
/// </summary>
[SuppressMessage("Usage", "xUnit1026:Theory methods should use all of their parameters")]
[SuppressMessage("Usage", "xUnit1028:Test method must have valid return type")]
public class CaptchaTests(WebTestApplicationFactory<Startup> factory, ITestOutputHelper testOutputHelper)
: WebApiTestBase<Startup>(factory, testOutputHelper), ICaptchaModule
{
/// <inheritdoc />
[Fact]
public async Task<GetCaptchaRsp> GetCaptchaImageAsync()
{
var rsp = await PostJsonAsync(typeof(CaptchaController));
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
/// <inheritdoc />
[InlineData(default)]
[Theory]
public async Task<bool> VerifyCaptchaAsync(VerifyCaptchaReq req)
{
var rsp = await PostJsonAsync(typeof(CaptchaController), req);
Assert.True(rsp.IsSuccessStatusCode);
return default;
}
}