Enhance family and roster management in school simulation by implementing support for incomplete families, ensuring proper handling of absent parents while maintaining surname consistency. Update family creation logic to account for single-parent households and revise child identification to prevent ID conflicts. Introduce seat shuffling to prevent siblings from being placed in the same class, improving the realism of student distribution. Update related tests to validate these new functionalities and ensure robustness in family and roster handling.
This commit is contained in:
@@ -21,14 +21,21 @@ public class RosterBrowserTests
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Alphabetical, with Ё counted as Е — see <c>RosterBrowser.NameOrder</c>. Ordinal order would
|
||||
/// agree on this sample (no vanilla surname starts with Ё), which is exactly why the rule is
|
||||
/// pinned down separately in <c>ReviewFixTests</c>.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void SortBySurname_IsAscendingOrdinal()
|
||||
public void SortBySurname_IsAlphabetical()
|
||||
{
|
||||
var roster = Fixtures.Generate(Fixtures.Classrooms(4));
|
||||
var page = RosterBrowser.Apply(roster, Fixtures.AsOf, Query(pageSize: 20));
|
||||
|
||||
var surnames = page.People.Select(person => person.Name.Surname).ToArray();
|
||||
var expected = surnames.OrderBy(name => name, StringComparer.Ordinal).ToArray();
|
||||
var expected = surnames
|
||||
.OrderBy(name => name.Replace('Ё', 'Е').Replace('ё', 'е'), StringComparer.Ordinal)
|
||||
.ToArray();
|
||||
Assert.Equal(expected, surnames);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user