public async void TestForDeleteLeagueArticleById() { var options = new DbContextOptionsBuilder <NewsContext>() .UseInMemoryDatabase(databaseName: "p3NewsService") .Options; using (var context = new NewsContext(options)) { context.Database.EnsureDeleted(); context.Database.EnsureCreated(); Repo r = new Repo(context, new NullLogger <Repo>()); Logic logic = new Logic(r, new NullLogger <Repo>()); NewsController newsController = new NewsController(logic); var leagueArticle = new LeagueArticle() { ArticleID = Guid.NewGuid(), Title = "free hotdogs", Body = "come today to get your hotdogs!", Date = DateTime.Now, IsPinned = true, IsVisible = true }; r.LeagueArticles.Add(leagueArticle); await r.CommitSave(); Assert.NotEmpty(context.LeagueArticles); await newsController.DeleteLeagueArticleById(leagueArticle.ArticleID); Assert.Null(context.LeagueArticles.Find(leagueArticle.ArticleID)); } }