Refactor Home UI controls and add dice to campaign log entries

This commit is contained in:
2026-02-26 09:22:29 +01:00
parent 96238a9341
commit 2d1bf9b9b7
20 changed files with 774 additions and 255 deletions

View File

@@ -32,7 +32,7 @@ public sealed class HostingCoverageTests
}
[Fact]
public void SqliteSchemaUpgrader_MigratesLegacySkillsSchema()
public void SqliteSchemaUpgrader_MigratesLegacySchema()
{
var dbPath = Path.Combine(Path.GetTempPath(), $"rpgroller-legacy-upgrade-{Guid.NewGuid():N}.db");
var connectionString = $"Data Source={dbPath}";
@@ -119,6 +119,17 @@ public sealed class HostingCoverageTests
Assert.Contains("WildDice", columns);
Assert.Contains("AllowFumble", columns);
using var rollTableInfoCommand = verifyConnection.CreateCommand();
rollTableInfoCommand.CommandText = "PRAGMA table_info('RollLogEntries');";
using var rollTableInfoReader = rollTableInfoCommand.ExecuteReader();
var rollColumns = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
while (rollTableInfoReader.Read())
{
rollColumns.Add(rollTableInfoReader.GetString(1));
}
Assert.Contains("Dice", rollColumns);
using var historyCommand = verifyConnection.CreateCommand();
historyCommand.CommandText = "SELECT COUNT(*) FROM \"__EFMigrationsHistory\" WHERE \"MigrationId\" = '20260226084000_InitialSchema';";
var historyCount = Convert.ToInt32(historyCommand.ExecuteScalar());
@@ -128,5 +139,10 @@ public sealed class HostingCoverageTests
modelSyncHistoryCommand.CommandText = "SELECT COUNT(*) FROM \"__EFMigrationsHistory\" WHERE \"MigrationId\" = '20260226090000_ModelSync';";
var modelSyncHistoryCount = Convert.ToInt32(modelSyncHistoryCommand.ExecuteScalar());
Assert.Equal(1, modelSyncHistoryCount);
using var rollDiceHistoryCommand = verifyConnection.CreateCommand();
rollDiceHistoryCommand.CommandText = "SELECT COUNT(*) FROM \"__EFMigrationsHistory\" WHERE \"MigrationId\" = '20260226100000_AddRollLogDice';";
var rollDiceHistoryCount = Convert.ToInt32(rollDiceHistoryCommand.ExecuteScalar());
Assert.Equal(1, rollDiceHistoryCount);
}
}