2026-08-31 17:35:02 +01:00
|
|
|
using IdentityServer8.Stores;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
2026-06-27 21:03:16 +01:00
|
|
|
namespace Yavsc.Org.Tests.Smoke;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Smoke for the Account BC (login / registration / OIDC discovery).
|
|
|
|
|
/// Hits the in-memory test server through
|
|
|
|
|
/// <see cref="TestWebApplicationFactory"/>: no sockets, no
|
|
|
|
|
/// self-signed certificates, no real DB (the
|
|
|
|
|
/// <c>AddInMemoryCollection</c> in <c>WebServerFixture.SetupHost</c>
|
|
|
|
|
/// points the EF context at the in-memory provider).
|
|
|
|
|
///
|
|
|
|
|
/// <c>GET /signin</c> is the public login endpoint served by
|
|
|
|
|
/// <c>Yavsc.Org/Controllers/Accounting/AccountController</c>
|
|
|
|
|
/// (decorated <c>[HttpGet(YavscConstants.SigninPath)]</c> with
|
|
|
|
|
/// <c>YavscConstants.SigninPath = "~/signin"</c>). A 200 means the
|
|
|
|
|
/// entire pipeline (routing + Razor + IdentityServer + EF + DI)
|
|
|
|
|
/// is wired correctly end-to-end.
|
|
|
|
|
/// </summary>
|
2026-09-12 14:30:50 +01:00
|
|
|
public class AccountSmokeTests : IClassFixture<TestWebApplicationFactory>
|
2026-06-27 21:03:16 +01:00
|
|
|
{
|
|
|
|
|
private readonly TestWebApplicationFactory _factory;
|
|
|
|
|
|
|
|
|
|
public AccountSmokeTests(TestWebApplicationFactory factory)
|
|
|
|
|
{
|
|
|
|
|
_factory = factory;
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-31 17:35:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task ResourceStore_get_all_resources_does_not_throw()
|
|
|
|
|
{
|
|
|
|
|
using var scope = _factory.Services.CreateScope();
|
|
|
|
|
var resourceStore = scope.ServiceProvider.GetRequiredService<IResourceStore>();
|
|
|
|
|
|
|
|
|
|
var exception = await Record.ExceptionAsync(resourceStore.GetAllResourcesAsync);
|
|
|
|
|
|
|
|
|
|
Assert.Null(exception);
|
|
|
|
|
}
|
2026-06-27 21:03:16 +01:00
|
|
|
}
|