Fix broken tests
This commit is contained in:
@@ -12,7 +12,7 @@ public class UnassignedStudentScheduler
|
|||||||
{
|
{
|
||||||
_teams = teams;
|
_teams = teams;
|
||||||
_students = teams.SelectMany(t => t.Students).Distinct().ToArray();
|
_students = teams.SelectMany(t => t.Students).Distinct().ToArray();
|
||||||
_timeSlots = timeslots.Select(ts => ts.Select(t => t.Clone()).ToArray()).ToArray();
|
_timeSlots = timeslots.Select(ts => ts.Select(t => t.Clone()).ToList()).ToArray();
|
||||||
}
|
}
|
||||||
public static IEnumerable<Student> UnassignedStudents(IList<Student> students, IList<Team> timeSlot)
|
public static IEnumerable<Student> UnassignedStudents(IList<Student> students, IList<Team> timeSlot)
|
||||||
=> students.Where(s => !timeSlot.SelectMany(t => t.Students).Contains(s));
|
=> students.Where(s => !timeSlot.SelectMany(t => t.Students).Contains(s));
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public class EventAssignmentTests
|
|||||||
var eventAssignment = new EventAssignment(events, students, new AssignmentParameters());
|
var eventAssignment = new EventAssignment(events, students, new AssignmentParameters());
|
||||||
var solution = eventAssignment.Solve().Result;
|
var solution = eventAssignment.Solve().Result;
|
||||||
|
|
||||||
var teamWriter = new TeamWriter(solution.Teams, @"c:\temp\teams.csv");
|
//var teamWriter = new TeamWriter(solution.Teams, @"c:\temp\teams.csv");
|
||||||
teamWriter.Write();
|
//teamWriter.Write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ public static class TestEntityHandler
|
|||||||
|
|
||||||
public static FileInfo GetEventOccurrenceFileInfo()
|
public static FileInfo GetEventOccurrenceFileInfo()
|
||||||
{
|
{
|
||||||
return FileUtility.GetContentFile(ContentDirectory, "2025 TSA Nationals Competition Events Times.txt");
|
return FileUtility.GetContentFile(ContentDirectory, "2025 TSA Nationals Competition Event Times.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Student[] GetStudents(IList<EventDefinition> events)
|
public static Student[] GetStudents(IList<EventDefinition> events)
|
||||||
@@ -35,7 +35,7 @@ public static class TestEntityHandler
|
|||||||
public static Team[] GetTeams(IList<EventDefinition> events, IList<Student> students)
|
public static Team[] GetTeams(IList<EventDefinition> events, IList<Student> students)
|
||||||
{
|
{
|
||||||
//var studentEventRankingsCsv = "Student Event Rankings.csv";
|
//var studentEventRankingsCsv = "Student Event Rankings.csv";
|
||||||
var studentEventRankingsCsv = "2023-24 RMS TSA student & event - TimeSlots.csv";
|
var studentEventRankingsCsv = "2023-24 RMS TSA student & event - Teams.csv";
|
||||||
|
|
||||||
var fileInfo = FileUtility.GetContentFile(ContentDirectory, studentEventRankingsCsv);
|
var fileInfo = FileUtility.GetContentFile(ContentDirectory, studentEventRankingsCsv);
|
||||||
var eventRankingsParser = new TeamParser(fileInfo);
|
var eventRankingsParser = new TeamParser(fileInfo);
|
||||||
@@ -50,14 +50,14 @@ public static class TestEntityHandler
|
|||||||
|
|
||||||
public static AssignmentRequirement[] GetEventRequirements(IList<EventDefinition> events, IList<Student> students)
|
public static AssignmentRequirement[] GetEventRequirements(IList<EventDefinition> events, IList<Student> students)
|
||||||
{
|
{
|
||||||
var fileInfo = FileUtility.GetContentFile(ContentDirectory, "2024-25 RMS TSA student & eventDefinition - assumptions.csv");
|
var fileInfo = FileUtility.GetContentFile(ContentDirectory, "2024-25 RMS TSA student & event - assumptions.csv");
|
||||||
var assumptionParser = new AssignmentRequirementParser(fileInfo);
|
var assumptionParser = new AssignmentRequirementParser(fileInfo);
|
||||||
return assumptionParser.Parse(events, students);
|
return assumptionParser.Parse(events, students);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static StudentEventRanking[] GetStudentEventRankings(Student[] students, EventDefinition[] events)
|
public static StudentEventRanking[] GetStudentEventRankings(Student[] students, EventDefinition[] events)
|
||||||
{
|
{
|
||||||
var fileInfo = FileUtility.GetContentFile(ContentDirectory, "2024-25 RMS TSA - Student Event Rankings.csv");
|
var fileInfo = FileUtility.GetContentFile(ContentDirectory, "2024-25 RMS TSA student & event - Student Event Rankings.csv");
|
||||||
|
|
||||||
var rankingParser = new StudentEventRankingParser(fileInfo);
|
var rankingParser = new StudentEventRankingParser(fileInfo);
|
||||||
return rankingParser.Parse(students, events);
|
return rankingParser.Parse(students, events);
|
||||||
|
|||||||
Reference in New Issue
Block a user