Beispiel #1
0
        public void ShouldEditAttendance()
        {
            int attendanceId = Repository.Add(new Attendance
            {
                DateTimeLectureStart = DateTime.Parse("03/03/2019"),
                DateTimeLectureEnd   = DateTime.Parse("04/04/2019"),
                LecturerId           = dbContext.Lecturers.FirstOrDefault().Id,
                ModuleId             = dbContext.Modules.FirstOrDefault().Id
            });
            Attendance attendance  = Repository.GetById(attendanceId);
            DateTime   newDateTime = DateTime.Parse("09/09/2019");

            attendance.DateTimeLectureEnd = newDateTime;
            bool result = Repository.Edit(attendance);

            attendance = Repository.GetById(attendanceId);
            Assert.Multiple(() =>
            {
                Assert.IsTrue(result);
                Assert.That(attendance.DateTimeLectureEnd, Is.EqualTo(newDateTime).Within(1).Minutes);
            });
        }