feat: add optional student nickname for informal display
Keep legal first and last names for formal lists; show DisplayFirstName on teams, calendars, and import matching so two Josiahs can be told apart. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -196,6 +196,32 @@ public class YearTransitionPlanner_Tests
|
||||
Assert.That(result.UnmatchedNames, Is.EquivalentTo(new[] { "Nobody Here" }));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MatchPastedNames_MatchesNicknamePlusLastName()
|
||||
{
|
||||
var josiah = StudentBuilder.Create("Josiah", "Brown").WithNickname("Jo").WithGrade(7).Build();
|
||||
|
||||
var result = YearTransitionPlanner.MatchPastedNames(
|
||||
[josiah],
|
||||
["Jo Brown", "Brown, Jo"]);
|
||||
|
||||
Assert.That(result.MatchedStudentIds, Is.EquivalentTo(new[] { josiah.Id }));
|
||||
Assert.That(result.UnmatchedNames, Is.Empty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MatchPastedNames_LegalNameStillMatchesWhenNicknameSet()
|
||||
{
|
||||
var josiah = StudentBuilder.Create("Josiah", "Brown").WithNickname("Jo").WithGrade(7).Build();
|
||||
|
||||
var result = YearTransitionPlanner.MatchPastedNames(
|
||||
[josiah],
|
||||
["Josiah Brown", "Brown, Josiah"]);
|
||||
|
||||
Assert.That(result.MatchedStudentIds, Is.EquivalentTo(new[] { josiah.Id }));
|
||||
Assert.That(result.UnmatchedNames, Is.Empty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MatchPastedNames_AmbiguousWhenDuplicateNames()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user