public async Task UpdateLaboratory_GivenUpdatedLaboratory_ReturnLaboratoryId() { //Arrange var teacherService = new TeacherService(context, context); var teachers = await teacherService.GetAll(); var teacherId = teachers[teachers.Count - 1].Id; var laboratorysList = await laboratoryService.GetAll(); var lastLaboratory = laboratorysList[laboratorysList.Count - 1]; var updatedLaboratory = new LaboratoryCreateModel() { Name = lastLaboratory.Name, Weekday = "Friday", StartHour = 16, EndHour = 18, Group = lastLaboratory.Group }; //Act var result = await laboratoryService.Update(teacherId, lastLaboratory.Id, updatedLaboratory); //Assert Assert.IsInstanceOfType(result, typeof(System.Guid)); }
public async Task CreateNew_InsertOneLaboratory_ReturnLaboratoryId() { //Arrange var teacherService = new TeacherService(context, context); var teachers = await teacherService.GetAll(); var teacherId = teachers[teachers.Count - 1].Id; var subjectService = new SubjectService(context, context); var subjects = await subjectService.GetAllSubjects(); var subjectId = subjects[subjects.Count - 1].Id; LaboratoryCreateModel model = new LaboratoryCreateModel() { Name = "Laboratory .NET", Weekday = "Wednesday", StartHour = 10, EndHour = 12, Group = "A2" }; //Act var result = await laboratoryService.CreateNew(teacherId, subjectId, model); //Assert Assert.IsInstanceOfType(result, typeof(System.Guid)); }