Radicade Public Code

This commit is contained in:
JogmansonReal
2026-10-16 23:33:13 -07:00
commit 55175acdf6
832 changed files with 363261 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using RadicadeServer.DB;
namespace RadicadeServer.Tests;
/// <summary>
/// Builds the options every test context uses.
///
/// Each test asks for its own InMemory database, so each one needs its own
/// <see cref="DbContextOptions{TContext}"/> and EF builds a separate internal service
/// provider for it. Past twenty of those EF raises
/// <see cref="CoreEventId.ManyServiceProvidersCreatedWarning"/> as an exception, which
/// fails whichever tests happen to run after the twentieth provider rather than the test
/// that built it. That count is a property of how the harness allocates contexts, not of
/// the behaviour under test, so the warning is ignored once here instead of per test.
/// </summary>
internal static class TestDbOptions
{
public static DbContextOptionsBuilder<RecDBContext> Create() =>
new DbContextOptionsBuilder<RecDBContext>()
.ConfigureWarnings(w => w.Ignore(CoreEventId.ManyServiceProvidersCreatedWarning));
}