Пример #1
0
        private async Task TestEntityDelete(Lesson lessonToDelete)
        {
            List <Lesson> actualLessons = await lessonStorage.GetAllLesson();

            lessonStorage.DeleteLesson((int)lessonToDelete.Id);
            List <Lesson> actualLessons1 = await lessonStorage.GetAllLesson();

            Assert.AreEqual(actualLessons.Count - 1, actualLessons1.Count);

            for (int i = 0; i < listLesson.Count; i++)
            {
                Assert.AreNotEqual(actualLessons1[i].Id, (int)lessonToDelete.Id);
            }
        }
Пример #2
0
        [HttpDelete("{id}")] // api/lesson/735
        public async Task <ActionResult> DeleteLessonById(int id)
        {
            await lessonStorage.DeleteLesson(id);

            return(Ok());
        }