LANCommander/LANCommander.Server.UI.Tests/ServerCollection.cs
Aaron Powell c856a51504 Fix stack overflow on test disposal with FreshServerFixture
- Refactor FirstTimeSetupTests to use FreshServerFixture via ICollectionFixture
  instead of creating its own UITestApplicationFactory per test
- Skip _realHost.Dispose() in UITestApplicationFactory since the DI container's
  deep dependency chain causes an uncatchable native StackOverflowException
- All 62 tests pass with exit code 0 (61 pass, 1 skip)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-08 08:41:11 +11:00

20 lines
793 B
C#

namespace LANCommander.Server.UI.Tests;
/// <summary>
/// xUnit collection definition that shares a single ConfiguredServerFixture across all
/// test classes in the "Server" collection. This avoids creating multiple WebApplicationFactory
/// instances that fight over the static DatabaseContext.Provider.
/// </summary>
[CollectionDefinition("Server")]
public class ServerCollection : ICollectionFixture<ConfiguredServerFixture>
{
}
/// <summary>
/// Separate collection for FirstTimeSetupTests which needs its own unconfigured server.
/// Having it in its own collection ensures it doesn't share state with the Server collection.
/// </summary>
[CollectionDefinition("FirstTimeSetup")]
public class FirstTimeSetupCollection : ICollectionFixture<FreshServerFixture>
{
}