-
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.
Add UserCollectionNavigator unit tests
- Loading branch information
Showing
3 changed files
with
54 additions
and
7 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
43 changes: 43 additions & 0 deletions
43
SWDestinyTradesTests/Screens/UserCollection/Navigator/UserCollectionNavigatorTests.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 @@ | ||
// | ||
// UserCollectionNavigatorTests.swift | ||
// SWDestinyTradesTests | ||
// | ||
// Created by Diogo Autilio on 21/03/24. | ||
// Copyright © 2024 Diogo Autilio. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import XCTest | ||
|
||
@testable import SWDestinyTrades | ||
|
||
final class UserCollectionNavigatorTests: XCTestCase { | ||
|
||
private var sut: UserCollectionNavigator! | ||
private var navigationController: UINavigationControllerMock! | ||
|
||
override func setUp() { | ||
super.setUp() | ||
let controller = UIViewController() | ||
navigationController = UINavigationControllerMock(rootViewController: controller) | ||
sut = UserCollectionNavigator(controller) | ||
} | ||
|
||
override func tearDown() { | ||
navigationController = nil | ||
sut = nil | ||
super.tearDown() | ||
} | ||
|
||
func test_navigate_to_cardDetailViewController() { | ||
sut.navigate(to: .cardDetail(database: nil, with: [.stub()], card: .stub())) | ||
|
||
XCTAssertTrue(navigationController.currentPushedViewController is CardDetailViewController) | ||
} | ||
|
||
func test_navigate_to_addCardViewController() { | ||
sut.navigate(to: .addCard(database: nil, with: .stub())) | ||
|
||
XCTAssertTrue(navigationController.currentPushedViewController is AddCardViewController) | ||
} | ||
} |