public void TestDeleteTeaser() { var article = this.MakeSampleArticle(); var teaser = new Teaser(article) { Preamble = "New teaser", ImageLink = "Text" }; teaser.Create(); int id = teaser.Id; teaser.Delete(); teaser.Read(id); }
public void TestCreateAndReadTeaser() { var article = this.MakeSampleArticle(); var teaser = new Teaser(article) { Preamble = "New teaser", ImageLink = "Text" }; Assert.AreEqual(0, teaser.Id); teaser.Create(); Assert.IsTrue(teaser.Id > 0); var sameTeaser = new Teaser(article); sameTeaser.Read(teaser.Id); Assert.AreEqual(teaser.ImageLink, sameTeaser.ImageLink); Assert.AreEqual(teaser.Preamble, sameTeaser.Preamble); Assert.AreEqual(teaser.Id, sameTeaser.Id); }
public void TestUpdateTeaser() { var article = this.MakeSampleArticle(); var teaser = new Teaser(article) { Preamble = "New teaser", ImageLink = "Text" }; teaser.Create(); teaser.Preamble = "header 2"; teaser.Update(); teaser.Read(); Assert.AreEqual("header 2", teaser.Preamble); }