Пример #1
0
        public void PageIndex_CanCorrectlyUpdatePageIndex_ChangePageMethodUpdatesPageIndex(int itemCount,
                                                                                           int itemsPerPage, int startPageIndex,
                                                                                           HorizontalDirection direction, int expectedPageIndex)
        {
            // Arrange
            int[] items = CreateIntArray(itemCount);

            // Act
            PageNavigator <int> pageNavigator = new PageNavigator <int>(items, out pageItems, itemsPerPage);

            pageNavigator.SetPage(startPageIndex);
            pageNavigator.ChangePage(direction);

            // Assert
            Assert.AreEqual(expectedPageIndex, pageNavigator.PageIndex);
        }
Пример #2
0
        public void PageItems_CanCreatePageItemArray_PageItemArrayContainsCorrectElements(int itemCount,
                                                                                          int itemsPerPage, int startPageIndex,
                                                                                          HorizontalDirection direction, int[] expectedIntArray)
        {
            // Arrange
            int[] items = CreateIntArray(itemCount);

            // Act
            PageNavigator <int> pageNavigator = new PageNavigator <int>(items, out pageItems, itemsPerPage);

            pageNavigator.PageChanged += PageChanged;
            pageNavigator.SetPage(startPageIndex);
            pageNavigator.ChangePage(direction);

            // Assert
            CollectionAssert.AreEqual(expectedIntArray, pageItems);
        }
Пример #3
0
 public override void Execute() => _navigator.ChangePage(_page);