public async Task ArchiveClassroomAsync_MarksOldClassroomAsInactive() { var databaseBuilder = GetDatabase(); var archiver = new ClassroomArchiver(databaseBuilder.Options); await archiver.ArchiveClassroomAsync("Class1", "Class1Archived"); var database = databaseBuilder.Build(); var oldClassroom = database.Context .Classrooms .Single(c => c.Name == "Class1Archived"); Assert.False(oldClassroom.IsActive); }
public async Task ArchiveClassroomAsync_DuplicatesQuestionRelatedEntities() { var databaseBuilder = GetDatabase(); var archiver = new ClassroomArchiver(databaseBuilder.Options); await archiver.ArchiveClassroomAsync("Class1", "Class1Archived"); var database = databaseBuilder.Build(); var oldClassroom = database.Context .Classrooms .Single(c => c.Name == "Class1Archived"); var newClassroom = database.Context .Classrooms .Single(c => c.Name == "Class1"); VerifyQuestionCategories(database.Context, oldClassroom, newClassroom); }