Implement applicant pool functionality in school simulation, allowing for the management of job seekers who are not yet part of the school roster. Update the catalog to include staffing definitions and enhance the API to support applicant data retrieval. Revise the school architecture to handle applicant refresh logic and ensure proper integration with existing roster management. Update tests to validate the new applicant functionalities and ensure robustness in handling staffing scenarios.

This commit is contained in:
Leonid Pershin
2026-08-19 00:01:56 +03:00
parent 65feda3756
commit c189578680
31 changed files with 541 additions and 120 deletions
@@ -95,17 +95,19 @@ public class RosterGeneratorTests
}
[Fact]
public void OneClassroomAndEleven_BothFillSeatsAndJobs()
public void OneClassroomAndEleven_BothFillSeatsAndLeaveJobsEmpty()
{
AssertFilled(Fixtures.Generate(Fixtures.Classrooms(1)), classrooms: 1);
AssertFilled(Fixtures.Generate(Fixtures.Classrooms(11)), classrooms: 11);
}
[Fact]
public void SomeStaffAreAlsoParents()
public void NewSchool_HasNoStaff()
{
var roster = Fixtures.Generate(Fixtures.VanillaMap());
Assert.Contains(roster.People, person => person.IsStaff && person.IsParent);
Assert.DoesNotContain(roster.People, person => person.IsStaff);
Assert.Equal(11 * 16, roster.People.Count(person => person.IsStudent));
Assert.Contains(roster.People, person => person.IsParent);
}
[Fact]
@@ -173,11 +175,8 @@ public class RosterGeneratorTests
});
var demand = SchoolDemand.From(Fixtures.Catalog(), Fixtures.Classrooms(classrooms));
Assert.Equal(demand.Staff.Count, roster.People.Count(person => person.IsStaff));
Assert.All(demand.Staff, opening =>
Assert.Contains(
roster.People,
person => person.IsStaff && person.Position == opening.Position && person.WorkplaceRoomId == opening.RoomId));
Assert.Equal(0, roster.People.Count(person => person.IsStaff));
Assert.True(RosterFit.Matches(roster, demand));
}
private static string Snapshot(Roster roster) =>