コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: Linerath/Linerath-Blog
        public void PaginationGettingTotalPagesWorks()
        {
            List <Article> data = new List <Article>
            {
                new Article {
                    Id = 0, Title = "T0"
                },
                new Article {
                    Id = 1, Title = "T1"
                },
                new Article {
                    Id = 2, Title = "T2"
                },
                new Article {
                    Id = 3, Title = "T3"
                },
                new Article {
                    Id = 4, Title = "T4"
                },
            };
            int pageSize = 2;

            int totalPages = PaginationService.GetTotalPages(data, pageSize);

            Assert.IsTrue(totalPages == 3);
        }