Example #1
0
        public void Can_Return_Published_Posts_Paged()
        {
            Initialize(true);

            using (var repository = new NHibernateBlogService())
            {
                for (int i = 0; i < 5; i++)
                {
                    var post = DummyLivePost();

                    repository.Save(post);
                }

                for (int i = 0; i < 5; i++)
                {
                    var post = DummyLivePost();

                    post.IsPublished = false;

                    repository.Save(post);
                }
            }
            using (var repository = new NHibernateBlogService())
            {
                Assert.AreEqual(2, repository.GetPublishedPostsPaged(2, 1).Count);
            }
        }