Пример #1
0
        public void IncorrectValueReturnedFromPagination_ZeroIsReturned()
        {
            var paginationItems = Mock.Of <IElements>(elemProxy => elemProxy.Select(It.IsAny <string>()).Last.OwnText() == "wrong");
            var document        = Mock.Of <IDocument>(doc => doc.GetAllElements() == paginationItems);
            var sut             = new MaxPageProvider(document);

            Assert.AreEqual(0, sut.GetMaxPage());
        }
Пример #2
0
        public void FourElementsOnPage_FourIsReturned()
        {
            var paginationItems = Mock.Of <IElements>(elemProxy => elemProxy.Select(It.IsAny <string>()).Last.OwnText() == "4");
            var document        = Mock.Of <IDocument>(doc => doc.GetAllElements() == paginationItems);
            var sut             = new MaxPageProvider(document);

            Assert.AreEqual(4, sut.GetMaxPage());
        }
Пример #3
0
        public void NoElementsOnPage_ZeroIsReturned()
        {
            var sut = new MaxPageProvider(Mock.Of <IDocument>());

            Assert.AreEqual(0, sut.GetMaxPage());
        }