Files
h-school/tests/HSchool.People.Tests/GoldenRosterTests.cs
T
Leonid PershinandCursor 1b66c89cd7 Replace selectable name sets with a country that owns names and climate presets.
Create picks a country; climate is rolled from the school seed and stored. Old Slavic saves lift as Russia.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-20 02:55:13 +03:00

28 lines
1.1 KiB
C#

namespace HSchool.People.Tests;
public class GoldenRosterTests
{
private const string Native = "RussianLanguage";
[Fact]
public void GoldenRoster_MatchesFixture()
{
var roster = Fixtures.Generate(Fixtures.Classrooms(4));
var actual = RosterFingerprint.Format(roster, Fixtures.SchoolSeed, "Russia", Native);
var relative = Path.Combine("golden", "roster.txt");
var output = Path.Combine(AppContext.BaseDirectory, relative);
var source = Path.Combine(Fixtures.RepoRoot(), "tests", "HSchool.People.Tests", relative);
if (string.Equals(Environment.GetEnvironmentVariable("WRITE_GOLDEN"), "1", StringComparison.Ordinal))
{
Directory.CreateDirectory(Path.GetDirectoryName(source)!);
File.WriteAllText(source, actual);
Directory.CreateDirectory(Path.GetDirectoryName(output)!);
File.WriteAllText(output, actual);
}
Assert.True(File.Exists(output), $"Golden roster is missing at {output}.");
RosterFingerprint.AssertEqual(File.ReadAllText(output), actual);
}
}