-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
50 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
43 changes: 43 additions & 0 deletions
43
SWDestinyTradesTests/Screens/PeopleList/Navigator/PeopleListNavigatorTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// PeopleListNavigatorTests.swift | ||
// SWDestinyTradesTests | ||
// | ||
// Created by Diogo Autilio on 01/03/24. | ||
// Copyright © 2024 Diogo Autilio. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import XCTest | ||
|
||
@testable import SWDestinyTrades | ||
|
||
final class PeopleListNavigatorTests: XCTestCase { | ||
|
||
private var sut: PeopleListNavigator! | ||
private var navigationController: UINavigationControllerMock! | ||
|
||
override func setUp() { | ||
super.setUp() | ||
let controller = UIViewController() | ||
navigationController = UINavigationControllerMock(rootViewController: controller) | ||
sut = PeopleListNavigator(controller) | ||
} | ||
|
||
override func tearDown() { | ||
navigationController = nil | ||
sut = nil | ||
super.tearDown() | ||
} | ||
|
||
func test_navigate_to_loansDetailViewController() { | ||
sut.navigate(to: .loanDetail(database: nil, with: .stub())) | ||
|
||
XCTAssertTrue(navigationController.currentPushedViewController is LoansDetailViewController) | ||
} | ||
|
||
func test_navigate_to_newPersonViewController() { | ||
sut.navigate(to: .newPerson(with: UpdateTableDataDelegateSpy())) | ||
|
||
XCTAssertTrue(navigationController.currentPushedViewController is NewPersonViewController) | ||
} | ||
} |