Ejemplo n.º 1
0
        public void Can_Load_Many_Saved_Categories_Paged_Results_Correctly()
        {
            Initialize(true);

            using (var repository = new NHibernateBlogService())
            {
                for (int i = 0; i < 9; i++)
                {
                    var category = new Category() { Name = String.Format("Test{0}", i) };

                    repository.Save(category);
                }
                Assert.AreEqual(4, repository.GetCategoriesPaged(4, 1).Count);
                Assert.AreEqual(4, repository.GetCategoriesPaged(4, 2).Count);
                Assert.AreEqual(1, repository.GetCategoriesPaged(4, 3).Count);
            }
        }
Ejemplo n.º 2
0
        public void Can_Load_Many_Saved_Categories_Paged()
        {
            Initialize(true);

            using (var repository = new NHibernateBlogService())
            {
                for (int i = 0; i < 10; i++)
                {
                    var category = new Category() { Name = "Test" };

                    repository.Save(category);
                }
                Assert.AreEqual(4, repository.GetCategoriesPaged(4, 1).Count);
            }
        }