public void CanTheContentBeDeleted() { _testRepo.Remove(_testid); var Content = _testRepo.FindByID(_testid); var expectedContent = new Content(); Assert.IsNull(Content); }
public static void ClassStart(TestContext context) { var config = GeneralHelpers.InitConfiguration(); ContentRepo a = new ContentRepo(config); _testRepo = a; var insert_value = a.FindAll().Where(w => w.slug == "new-post-from-test"); if (insert_value.Count() > 0) { var id = insert_value.Where(w => w.slug == "new-post-from-test").First().contentid; a.Remove(id); } Content con = new Content() { contentid = 6, headerimage = "Some image from test _ updated", tabimage = "Some Name from test _ updated", slug = "new-post-from-test _ updated", body = "some awesome tesx _ updated", title = "some title added from test _ updated", authorid = 1, views = 1, stars = (float)4.5, published = true, staged = true, draft = true, created_on = DateTime.Now, published_on = DateTime.Now }; _testRepo.Update(con); }
public void Delete(int id) { ContentRepo.Remove(id); _log.LogInformation($"The Content that was deleted {id.ToString()}"); }