refactor(bp): flatten BattlePassLevelEntry — drop misnamed RewardData jsonb

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-05-26 21:57:47 -04:00
parent 141f34f817
commit 95b8f39ea5
9 changed files with 3134 additions and 541 deletions

View File

@@ -7,11 +7,11 @@ using SVSim.UnitTests.Infrastructure;
namespace SVSim.UnitTests.Importers;
/// <summary>
/// Happy-path coverage for the 7 load-index importer classes introduced in Stage 9B
/// (RotationConfig, MyRotation, AvatarAbility, ArenaSeason, BattlePass, DailyLoginBonus,
/// Happy-path coverage for the load-index importer classes introduced in Stage 9B
/// (RotationConfig, MyRotation, AvatarAbility, ArenaSeason, DailyLoginBonus,
/// PreReleaseInfo). Each test instantiates the importer in isolation and verifies it inserts
/// rows from the corresponding seed file under <c>Data/seeds/</c>. Idempotency is spot-checked
/// in one test (BattlePass) to avoid duplicating the canonical 4-test set per importer.
/// rows from the corresponding seed file under <c>Data/seeds/</c>.
/// Idempotency, edge cases, and per-importer detail tests live in dedicated *ImporterTests files (e.g. BattlePassImporterTests).
/// </summary>
public class LoadIndexImporterTests
{
@@ -73,22 +73,6 @@ public class LoadIndexImporterTests
Assert.That(row!.FormatInfo, Is.Not.EqualTo("{}"), "format_info blob must be populated from seed");
}
[Test]
public async Task BattlePassImporter_writes_levels_and_is_idempotent()
{
using var factory = new SVSimTestFactory();
using var scope = factory.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SVSimDbContext>();
await new BattlePassImporter().ImportAsync(db, SeedDir);
int after1 = await db.BattlePassLevels.CountAsync();
await new BattlePassImporter().ImportAsync(db, SeedDir);
int after2 = await db.BattlePassLevels.CountAsync();
Assert.That(after1, Is.GreaterThan(0), "battle-pass-levels.json must produce rows");
Assert.That(after2, Is.EqualTo(after1), "rerun must be idempotent (no new rows)");
}
[Test]
public async Task DailyLoginBonusImporter_writes_bonus_rows()
{