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
+31
View File
@@ -0,0 +1,31 @@
using RadicadeServer.Utils;
using Xunit;
namespace RadicadeServer.Tests;
/// <summary>
/// RoomUtils/MatchmakingUtils expose their DbContext factories as process-wide statics, so
/// two test classes that replace them cannot run at the same time - whichever wins would
/// answer the other's queries. xUnit parallelizes classes by default, which made the suite
/// fail depending on scheduling; membership in this collection serializes those classes.
/// </summary>
[CollectionDefinition(Name)]
public class DbFactoryCollection : ICollectionFixture<RegistrationThrottleFixture>
{
public const string Name = "SharesDbFactoryStatics";
}
/// <summary>
/// The registration throttle is process-wide state. This suite creates dozens of accounts from
/// loopback using the same handful of device ids, so without this the run would spend itself
/// refusing its own fixtures and prove nothing about registration. The limits themselves are
/// covered on their own terms by AccountRegistrationTests, which sets its own and puts them back.
/// </summary>
public sealed class RegistrationThrottleFixture
{
public RegistrationThrottleFixture() =>
RegistrationGuard.Configure(
maxCreationsPerIp: int.MaxValue,
maxCreationsPerDevice: int.MaxValue,
minimumDeviceInterval: TimeSpan.Zero);
}