Exemplo n.º 1
0
        public void Pages_ShouldReturnTheCorrectNumberOfPagesInTheLastPage()
        {
            //Arrange
            var dynamicSQL = DynamicSQLWhereObject();

            settingManager.Stub(x => x.GetJewelryBaseWebPath()).Return("/jon-images/jewel/");

            JewelRepository jewelRepository = new JewelRepository(settingManager);

            jewelRepository.ItemsPerPage(3);
            jewelRepository.Page(4);
            //Act

            var jewelrylist = jewelRepository.GetJewelsByDynamicSQL(dynamicSQL);

            //Assert
            jewelrylist.Should().HaveCount(10 - 3 * 3);
        }
Exemplo n.º 2
0
        public void CurrentPage_ShouldReturnTheCurrentPage()
        {
            //Arrange
            var dynamicSQL = DynamicSQLWhereObject();

            settingManager.Stub(x => x.GetJewelryBaseWebPath()).Return("/jon-images/jewel/");

            JewelRepository jewelRepository = new JewelRepository(settingManager);

            jewelRepository.ItemsPerPage(3);
            jewelRepository.Page(2);
            //Act

            var jewelrylist = jewelRepository.GetJewelsByDynamicSQL(dynamicSQL);

            var currectpage = jewelRepository.CurrentPage;

            //Assert

            currectpage.Should().Be(2);
        }