blockchainethereumblockchain-walleterc20erc721walletxdaidappdecentralizederc1155erc875iosswifttokens
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
2.2 KiB
75 lines
2.2 KiB
// Copyright SIX DAY LLC. All rights reserved.
|
|
|
|
import XCTest
|
|
@testable import Trust
|
|
|
|
class AppCoordinatorTests: XCTestCase {
|
|
|
|
func testStart() {
|
|
let coordinator = AppCoordinator(
|
|
window: UIWindow(),
|
|
keystore: FakeKeystore()
|
|
)
|
|
|
|
coordinator.start()
|
|
|
|
XCTAssertTrue(coordinator.rootNavigationController.viewControllers[0] is WelcomeViewController)
|
|
}
|
|
|
|
func testStartWithAccounts() {
|
|
let coordinator = AppCoordinator(
|
|
window: UIWindow(),
|
|
keystore: FakeKeystore(
|
|
accounts: [.make()]
|
|
)
|
|
)
|
|
|
|
coordinator.start()
|
|
|
|
XCTAssertEqual(1, coordinator.coordinators.count)
|
|
XCTAssertTrue(coordinator.rootNavigationController.viewControllers[0] is TransactionsViewController)
|
|
}
|
|
|
|
func testReset() {
|
|
let coordinator = AppCoordinator(
|
|
window: UIWindow(),
|
|
keystore: FakeKeystore(
|
|
accounts: [.make()]
|
|
)
|
|
)
|
|
coordinator.start()
|
|
|
|
coordinator.reset()
|
|
|
|
XCTAssertTrue(coordinator.rootNavigationController.viewControllers[0] is WelcomeViewController)
|
|
}
|
|
|
|
func testStartWalletCoordinator() {
|
|
let coordinator = AppCoordinator(
|
|
window: UIWindow(),
|
|
keystore: FakeKeystore(
|
|
accounts: [.make()]
|
|
),
|
|
rootNavigationController: FakeNavigationController()
|
|
)
|
|
coordinator.start()
|
|
|
|
coordinator.showCreateWallet()
|
|
|
|
XCTAssertTrue((coordinator.rootNavigationController.presentedViewController as? UINavigationController)?.viewControllers[0] is CreateWalletViewController)
|
|
}
|
|
|
|
func testShowTransactions() {
|
|
let coordinator = AppCoordinator(
|
|
window: UIWindow(),
|
|
keystore: FakeKeystore(),
|
|
rootNavigationController: FakeNavigationController()
|
|
)
|
|
coordinator.start()
|
|
|
|
coordinator.showTransactions(for: .make())
|
|
|
|
XCTAssertEqual(1, coordinator.coordinators.count)
|
|
XCTAssertTrue(coordinator.rootNavigationController.viewControllers[0] is TransactionsViewController)
|
|
}
|
|
}
|
|
|