コード例 #1
0
        public void DeletePlanningTest()
        {
            // ARRANGE
            PlannerService service = new PlannerService(ctxDb);
            int            cmId    = AddCm();

            int scheduleId = ctxDb.Schedule.Where(s => s.Datum == new DateTime(DateTime.Now.Year, DateTime.Now.Month, (DateTime.Now.Day + 1))).FirstOrDefault().Id;
            int roomId     = ctxDb.Room.Where(r => r.Gebouw == "A" & r.Verdiep == 0 & r.Nummer == "01").FirstOrDefault().Id;

            // ACT
            service.DeletePlanning(cmId);

            // ASSERT
            Assert.IsNull(ctxDb.CourseMoment.Where(cm => cm.ScheduleId == scheduleId && cm.RoomId == roomId).FirstOrDefault());
            Assert.IsTrue(!ctxDb.CourseMoment.Any());
        }