- Updated `protocol.md` to clarify the concept of uncovered subjects and the number of additional teachers required. - Introduced `teachersShort` property in the `StaffingSubject` interface to indicate how many more teachers are needed for a subject. - Enhanced localization strings to reflect the new uncovered teacher information in both English and Russian. - Updated the management panel UI to display the number of teachers short for each uncovered subject. - Revised the `Uncovered` method in the staffing logic to return detailed information about uncovered subjects, including the shortfall of teachers. - Added tests to validate the new uncovered teacher tracking functionality and ensure accurate reporting in the staffing API. - Marked related tasks as complete in the documentation for the golden fixtures phase.
28 lines
1.1 KiB
C#
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, "Slavic", 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);
|
|
}
|
|
}
|