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