Skip to content

Commit

Permalink
Fix tests target
Browse files Browse the repository at this point in the history
  • Loading branch information
msaps committed Aug 1, 2018
1 parent 041e1de commit b68e73e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Sources/PageboyTests/PageboyAutoScrollTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PageboyAutoScrollTests: PageboyTests {
self.pageboyViewController.autoScroller.disable()

XCTAssert(self.pageboyViewController.autoScroller.isEnabled == false &&
self.pageboyViewController.autoScroller.wasEnabled != true,
self.pageboyViewController.autoScroller.wasCancelled != true,
"PageboyAutoScroller does not disable correctly.")
}

Expand All @@ -56,7 +56,7 @@ class PageboyAutoScrollTests: PageboyTests {
self.pageboyViewController.autoScroller.cancel()

XCTAssert(self.pageboyViewController.autoScroller.isEnabled == false &&
self.pageboyViewController.autoScroller.wasEnabled == true,
self.pageboyViewController.autoScroller.wasCancelled == true,
"PageboyAutoScroller does not allow cancellation correctly.")
}

Expand All @@ -69,7 +69,7 @@ class PageboyAutoScrollTests: PageboyTests {
self.pageboyViewController.autoScroller.cancel()

let isEnabled = self.pageboyViewController.autoScroller.isEnabled
let wasEnabled = self.pageboyViewController.autoScroller.wasEnabled ?? false
let wasEnabled = self.pageboyViewController.autoScroller.wasCancelled ?? false

self.pageboyViewController.autoScroller.restart()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TestPageboyDataSource: PageboyViewControllerDataSource {
self.viewControllers = generateViewControllers(count: numberOfPages)
}
}
var defaultIndex: Page?
var defaultIndex: PageboyViewController.Page?
private(set) var viewControllers: [UIViewController]?

// MARK: PageboyViewControllerDataSource
Expand All @@ -30,11 +30,11 @@ class TestPageboyDataSource: PageboyViewControllerDataSource {
}

func viewController(for pageboyViewController: PageboyViewController,
at index: PageIndex) -> UIViewController? {
at index: PageboyViewController.PageIndex) -> UIViewController? {
return self.viewControllers?[index]
}

func defaultPage(for pageboyViewController: PageboyViewController) -> Page? {
func defaultPage(for pageboyViewController: PageboyViewController) -> PageboyViewController.Page? {
return defaultIndex
}

Expand Down
16 changes: 8 additions & 8 deletions Sources/PageboyTests/TestComponents/TestPageboyDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,36 @@ class TestPageboyDelegate: PageboyViewControllerDelegate {

var lastRecordedPagePosition: CGPoint?
var lastRecordedPageIndex: Int?
var lastRecordedDirection: NavigationDirection?
var lastRecordedDirection: PageboyViewController.NavigationDirection?

var lastWillScrollToPageAnimated: Bool?
var lastDidScrollToPositionAnimated: Bool?
var lastDidScrollToPageAtIndexAnimated: Bool?

var lastDidReloadPageCount: Int?
var lastDidReloadCurrentViewController: UIViewController?
var lastDidReloadCurrentIndex: PageIndex?
var lastDidReloadCurrentIndex: PageboyViewController.PageIndex?
var reloadCount: Int = 0

func pageboyViewController(_ pageboyViewController: PageboyViewController,
willScrollToPageAt index: PageIndex,
direction: NavigationDirection,
willScrollToPageAt index: PageboyViewController.PageIndex,
direction: PageboyViewController.NavigationDirection,
animated: Bool) {
lastWillScrollToPageAnimated = animated
}

func pageboyViewController(_ pageboyViewController: PageboyViewController,
didScrollTo position: CGPoint,
direction: NavigationDirection,
direction: PageboyViewController.NavigationDirection,
animated: Bool) {
lastDidScrollToPositionAnimated = animated
lastRecordedPagePosition = position
lastRecordedDirection = direction
}

func pageboyViewController(_ pageboyViewController: PageboyViewController,
didScrollToPageAt index: PageIndex,
direction: NavigationDirection,
didScrollToPageAt index: PageboyViewController.PageIndex,
direction: PageboyViewController.NavigationDirection,
animated: Bool) {
lastDidScrollToPageAtIndexAnimated = animated
lastRecordedPageIndex = index
Expand All @@ -51,7 +51,7 @@ class TestPageboyDelegate: PageboyViewControllerDelegate {

func pageboyViewController(_ pageboyViewController: PageboyViewController,
didReloadWith currentViewController: UIViewController,
currentPageIndex: PageIndex) {
currentPageIndex: PageboyViewController.PageIndex) {
lastDidReloadPageCount = pageboyViewController.pageCount
lastDidReloadCurrentViewController = currentViewController
lastDidReloadCurrentIndex = currentPageIndex
Expand Down

0 comments on commit b68e73e

Please sign in to comment.