public void Delete_quiz_from_database() { var options = new DbContextOptionsBuilder <QuizDbContext>() .UseInMemoryDatabase(databaseName: "Delete_quiz_from_database") .Options; Add_example_recorods(options); using (var context = new QuizDbContext(options)) { var service = new QuizService(context); service.DeleteQuizByID(1); var numberOfQuizesInDb = context.Quiz.Count(); var idOfLastedQuiz = context.Quiz.Single().Id; numberOfQuizesInDb.Should().Be(1); idOfLastedQuiz.Should().Be(2); } }