public async Task GetClassroomAsync_DoesntExist_ReturnNull() { var database = new TestDatabaseBuilder() .AddClassroom("Class1") .Build(); var classroomService = new ClassroomService(database.Context); var classroom = await classroomService.GetClassroomAsync("Class2"); Assert.Null(classroom); }
public async Task GetClassroomAsync_Exists_ReturnsClassroom() { var database = new TestDatabaseBuilder() .AddClassroom("Class1") .AddClassroom("Class2") .Build(); var classroomId = database.Context.Classrooms.First().Id; database.Reload(); var classroomService = new ClassroomService(database.Context); var classroom = await classroomService.GetClassroomAsync("Class1"); Assert.Equal("Class1", classroom.Name); }