diff --git a/SVSim.UnitTests/Infrastructure/SVSimTestFactory.cs b/SVSim.UnitTests/Infrastructure/SVSimTestFactory.cs index 08bddeb..ba6b73e 100644 --- a/SVSim.UnitTests/Infrastructure/SVSimTestFactory.cs +++ b/SVSim.UnitTests/Infrastructure/SVSimTestFactory.cs @@ -315,6 +315,20 @@ internal sealed class SVSimTestFactory : WebApplicationFactory await db.SaveChangesAsync(); } + /// + /// Sets the viewer's RedEther balance to . Call this AFTER + /// , which resets RedEther to 0. Create tests use this + /// to give the viewer enough vials to craft. + /// + public async Task SetRedEtherAsync(long viewerId, ulong amount) + { + using var scope = Services.CreateScope(); + var db = scope.ServiceProvider.GetRequiredService(); + var viewer = await db.Viewers.FirstAsync(v => v.Id == viewerId); + viewer.Currency.RedEther = amount; + await db.SaveChangesAsync(); + } + /// /// Puts copies of into the viewer's deck /// in the given format + slot. Tests use this to set up deck-strip scenarios for /card/destruct.