自动排考

This commit is contained in:
2026-07-27 21:27:00 +08:00 Unverified
parent c3e8a42641
commit 9d9f54a3b0
4 changed files with 443 additions and 92 deletions
@@ -256,10 +256,27 @@ public sealed class TeachingWorkflowRosterTests
Assert.IsType<NoContentResult>(publishResult);
var planResult = Assert.IsType<OkObjectResult>(
await exams.GetPlan(examPlan.Id, CancellationToken.None));
await exams.GetPlan(
examPlan.Id,
cancellationToken: CancellationToken.None));
var planSessions = ReadEnumerableProperty(planResult.Value!, "Sessions");
Assert.Equal(1, ReadIntProperty(planSessions.Single(), "StudentCount"));
Assert.Single(ReadEnumerableProperty(planSessions.Single(), "ExamRooms"));
var returnedRoom = Assert.Single(
ReadEnumerableProperty(planSessions.Single(), "ExamRooms"));
Assert.Equal(
classroom.Id,
returnedRoom.GetType().GetProperty("ClassroomId")!.GetValue(returnedRoom));
Assert.Equal(1, ReadIntProperty(returnedRoom, "SeatCount"));
Assert.Equal(1, ReadIntProperty(returnedRoom, "TotalSeatCount"));
Assert.False(
(bool)returnedRoom.GetType().GetProperty("IsMixed")!
.GetValue(returnedRoom)!);
Assert.Equal(
[teacher.Id],
ReadEnumerableProperty(returnedRoom, "InvigilatorIds").Cast<Guid>());
Assert.Equal(
[teacher.Name],
ReadEnumerableProperty(returnedRoom, "InvigilatorNames").Cast<string>());
var examSessionId = examPlan.Sessions.Single().Id;
var rosterResult = Assert.IsType<OkObjectResult>(