Exemplo n.º 1
0
        public void CanLoadAllStaticPages()
        {
            InMemoryRepo repo = new InMemoryRepo();

            var pageList = repo.GetAllStaticPosts();

            Assert.AreEqual(3, pageList.Count());

            StaticPost page = pageList.FirstOrDefault(b => b.StaticPostId == 1);

            Assert.AreEqual(1, page.StaticPostId);
            Assert.AreEqual("Test Static Page", page.Title);
            Assert.AreEqual(" <!DOCTYPE html><html><head><meta charset = 'UTF-8'><title>Sample Static Title</title></head><body>This is the body of a sample static page.</body></html>", page.Content);
        }
Exemplo n.º 2
0
        public void CanAddStaticPage()
        {
            InMemoryRepo repo = new InMemoryRepo();
            var          page = new StaticPost
            {
                Title   = "Testimonials",
                Content = " <!DOCTYPE html><html><head><meta charset = 'UTF-8'><title>Testimonials</title></head><body>Listen to people who love our services.</body></html>",
            };

            repo.AddStaticPost(page);

            var pageList = repo.GetAllStaticPosts();

            Assert.AreEqual(4, pageList.Count());

            page = repo.GetStaticPost(4);

            Assert.AreEqual(4, page.StaticPostId);
            Assert.AreEqual("Testimonials", page.Title);
            Assert.AreEqual(" <!DOCTYPE html><html><head><meta charset = 'UTF-8'><title>Testimonials</title></head><body>Listen to people who love our services.</body></html>", page.Content);
        }