Files
SVSimServer/SVSim.UnitTests/Services/FreeplayConfigTests.cs
gamer147 7b5edb7c65 feat(config): add Freeplay config section (default off)
Adds FreeplayConfig [ConfigSection("Freeplay")] with Enabled=false,
CurrencyAmount=99999, CardCopies=3, and ShippedDefaults(). Covered by
FreeplayConfigTests verifying the tier-chain resolves shipped defaults.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 13:25:47 -04:00

27 lines
919 B
C#

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using SVSim.Database;
using SVSim.Database.Models.Config;
using SVSim.EmulatedEntrypoint.Services;
using SVSim.UnitTests.Infrastructure;
namespace SVSim.UnitTests.Services;
public class FreeplayConfigTests
{
[Test]
public void Freeplay_defaults_to_disabled_with_canonical_amounts()
{
using var factory = new SVSimTestFactory();
using var scope = factory.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SVSimDbContext>();
var svc = new GameConfigService(db, new ConfigurationBuilder().Build());
var cfg = svc.Get<FreeplayConfig>();
Assert.That(cfg.Enabled, Is.False, "freeplay must be off unless explicitly enabled");
Assert.That(cfg.CurrencyAmount, Is.EqualTo(99999UL));
Assert.That(cfg.CardCopies, Is.EqualTo(3));
}
}