Ejemplo n.º 1
0
        public void GetFooterStaticPages_CorrectOrder()
        {
            EFBlogPostRepository repo = new EFBlogPostRepository(SharedDbContext);

            var pages = repo.GetFooterStaticPages().ToList();

            for (int i = 0; i < 3; i++)
            {
                Assert.IsTrue(pages[i].FooterPriority < pages[i + 1].FooterPriority);
            }
        }
Ejemplo n.º 2
0
        public void GetFooterStaticPages_GetsPages()
        {
            EFBlogPostRepository repo = new EFBlogPostRepository(SharedDbContext);

            var pages = repo.GetFooterStaticPages();

            var titles = pages.Select(p => p.PageTitle).ToList();

            Assert.AreEqual(pages.Count(), 4);
            // should have only evens
            for (int i = 2; i < 10; i += 2)
            {
                Assert.Contains($"Static Page No {i}", titles);
                Assert.IsFalse(titles.Contains($"Static Page No {i - 1}"));
            }
        }