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); }
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); }
public override void Execute() => _navigator.ChangePage(_page);