public void DeleteVideoShouldDeleteVideoFromDatabase() { var options = new DbContextOptionsBuilder <ApplicationDbContext>().UseInMemoryDatabase("Database_For_DeletingVideos").Options; var dbContext = new ApplicationDbContext(options); var service = new VideoService(dbContext); dbContext.Videos.Add(new Video()); dbContext.Videos.Add(new Video()); dbContext.Videos.Add(new Video()); dbContext.SaveChanges(); var video = dbContext.Videos.First(); service.DeleteVideo(video); Assert.Equal(2, dbContext.Videos.Count()); }