public async Task DeleteSchedules_ScheduleDeleted_ShouldReturnokStatus()
        {
            //Act
            var mockresponse = await controller.DeleteSchedule() as StatusCodeResult;

            //Assert
            Assert.Equal(200, mockresponse.StatusCode);
        }
        private void dgSchedules_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            int      scheduleID = int.Parse(e.Item.Cells[0].Text);
            Schedule schedule   = scheduleController.GetSchedule(scheduleID);

            scheduleController.DeleteSchedule(schedule);
            ShowView();
        }
예제 #3
0
        public void Schedule_Delete()
        {
            string             key        = KeyHelper.GetKey <IScheduleRepository>();
            var                repository = RepositoryFactory.GetRepository <IScheduleRepository>(key);
            ScheduleController controller = new ScheduleController();
            Schedule           schedule   = CreateSchedule();
            int                scheduleID = schedule.ScheduleID;

            controller.DeleteSchedule(schedule);
            Assert.IsFalse(repository.Exists(scheduleID));
        }