public void CanAContentBeUpdated() { var maxid = _testRepo.FindAll().Min(m => m.contentid); Content a = new Content() { contentid = maxid, headerimage = "Some image from test _ updated", tabimage = "Some Name from test _ updated", slug = $"new-post-from-test _ updated{maxid}", 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(a); var updatedContent = _testRepo.FindByID(maxid); Assert.AreEqual(a.slug, updatedContent.slug); }
public IActionResult GetContent(int id) { return(Ok(ContentRepo.FindByID(id))); }