自动排课
This commit is contained in:
@@ -224,7 +224,7 @@ public sealed class AutomaticScheduleGeneratorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Generator_does_not_attach_duplicate_buildings_from_untracked_classrooms()
|
||||
public async Task Generator_uses_scoped_rooms_without_attaching_duplicate_buildings()
|
||||
{
|
||||
await using var connection = new SqliteConnection("Data Source=:memory:");
|
||||
await connection.OpenAsync();
|
||||
@@ -333,6 +333,34 @@ public sealed class AutomaticScheduleGeneratorTests
|
||||
EndsAt = new TimeOnly(9, 40)
|
||||
});
|
||||
await db.SaveChangesAsync();
|
||||
db.TeachingTaskScheduleConstraints.AddRange(
|
||||
new TeachingTaskScheduleConstraint
|
||||
{
|
||||
TeachingTaskId = smallTask.Id,
|
||||
RequiredCampusId = campus.Id,
|
||||
RequiredBuildingId = building.Id,
|
||||
AllowedClassrooms =
|
||||
[
|
||||
new TeachingTaskAllowedClassroom
|
||||
{
|
||||
ClassroomId = smallRoom.Id
|
||||
}
|
||||
]
|
||||
},
|
||||
new TeachingTaskScheduleConstraint
|
||||
{
|
||||
TeachingTaskId = largeTask.Id,
|
||||
RequiredCampusId = campus.Id,
|
||||
RequiredBuildingId = building.Id,
|
||||
AllowedClassrooms =
|
||||
[
|
||||
new TeachingTaskAllowedClassroom
|
||||
{
|
||||
ClassroomId = largeRoom.Id
|
||||
}
|
||||
]
|
||||
});
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
db.ChangeTracker.Clear();
|
||||
plan = await db.SchedulePlans.SingleAsync();
|
||||
|
||||
Reference in New Issue
Block a user