Skip to content

Commit

Permalink
Merge pull request #752 from DeluxeAlonso/feature/coordinator-improve…
Browse files Browse the repository at this point in the history
…ments

Feature/coordinator improvements
  • Loading branch information
DeluxeAlonso authored Aug 4, 2023
2 parents a54f714 + dcaed18 commit 67f5fcf
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ import UIKit
final class UpcomingMoviesCoordinatorTests: XCTestCase {

var navigationController: MockNavigationController!
var navigationDelegate: MockUpcomingMoviesNavigationDelegate!

override func setUpWithError() throws {
try super.setUpWithError()
navigationController = MockNavigationController()
navigationDelegate = MockUpcomingMoviesNavigationDelegate()
}

override func tearDownWithError() throws {
Expand Down Expand Up @@ -57,10 +59,21 @@ final class UpcomingMoviesCoordinatorTests: XCTestCase {
return
}
XCTAssertTrue(childCoordinator is MovieDetailCoordinatorProtocol)
XCTAssertEqual(navigationDelegate.configureCallCount, 1)
XCTAssertEqual(navigationDelegate.updateOffsetCallCount, 1)
}

func testSetupNavigationControllerDelegate() {
// Arrange
let coordinator = createSUT()
// Act
coordinator.setupNavigationControllerDelegate()
// Assert
XCTAssertEqual(navigationController.delegate?.description, navigationDelegate.description)
}

private func createSUT() -> UpcomingMoviesCoordinator {
UpcomingMoviesCoordinator(navigationController: navigationController, navigationDelegate: nil)
UpcomingMoviesCoordinator(navigationController: navigationController, navigationDelegate: navigationDelegate)
}

}

0 comments on commit 67f5fcf

Please sign in to comment.