public void CanAddStaticPage() { var repo = new StaticPageRepo(); var page = new StaticPage(); page.StaticPageId = 1; page.Title = "Disclaimer"; page.Body = "this is a test."; repo.AddStaticPage(page); var pages = repo.GetStaticPages(); Assert.AreEqual(3, pages.Count); Assert.AreEqual(3, pages[2].StaticPageId); Assert.AreEqual("Disclaimer", pages[2].Title); Assert.AreEqual("this is a test.", pages[2].Body); }
public void CanRemoveStaticPage() { var repo = new StaticPageRepo(); var page = new StaticPage(); page.StaticPageId = 1; page.Title = "fart"; page.Body = "Hi"; repo.AddStaticPage(page); var loaded = repo.GetStaticPageById(3); Assert.IsNotNull(loaded); repo.DeleteStaticPage(3); loaded = repo.GetStaticPageById(3); Assert.IsNull(loaded); }
public void CanUpdateStaticPage() { var page = new StaticPage(); var repo = new StaticPageRepo(); page.StaticPageId = 3; page.Title = "Hi"; page.Body = "Hi"; repo.AddStaticPage(page); page.StaticPageId = 3; page.Title = "Bye"; page.Body = "Bye"; repo.UpdateStaticPage(page); var updatedPage = repo.GetStaticPageById(page.StaticPageId); Assert.AreEqual(3, page.StaticPageId); Assert.AreEqual("Bye", page.Title); Assert.AreEqual("Bye", page.Body); }