An advanced Ethereum/EVM mobile wallet
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.
 
 
 
alpha-wallet-ios/AlphaWalletTests/Coordinators/TokensCoordinatorTests.swift

50 lines
2.2 KiB

// Copyright SIX DAY LLC. All rights reserved.
import XCTest
@testable import AlphaWallet
class FakeSwapTokenService: TokenActionsServiceType {
func register(service: TokenActionsProvider) {
}
func isSupport(token: TokenActionsServiceKey) -> Bool {
false
}
func actions(token: TokenActionsServiceKey) -> [TokenInstanceAction] {
[]
}
}
class TokensCoordinatorTests: XCTestCase {
func testRootViewController() {
var sessions = ServerDictionary<WalletSession>()
sessions[.main] = WalletSession.make()
let config: Config = .make()
let assetDefinitionStore = AssetDefinitionStore()
let tokenActionsService = FakeSwapTokenService()
let coordinator = TokensCoordinator(
navigationController: FakeNavigationController(),
sessions: sessions,
keystore: FakeKeystore(),
config: config,
tokenCollection: .init(filterTokensCoordinator: FilterTokensCoordinator(assetDefinitionStore: assetDefinitionStore, tokenActionsService: tokenActionsService, coinTickersFetcher: FakeCoinTickersFetcher()), tokenDataStores: []),
nativeCryptoCurrencyPrices: .init(),
assetDefinitionStore: AssetDefinitionStore(),
eventsDataStore: FakeEventsDataStore(),
promptBackupCoordinator: PromptBackupCoordinator(keystore: FakeKeystore(), wallet: .make(), config: config, analyticsCoordinator: FakeAnalyticsService()),
filterTokensCoordinator: FilterTokensCoordinator(assetDefinitionStore: assetDefinitionStore, tokenActionsService: tokenActionsService, coinTickersFetcher: FakeCoinTickersFetcher()),
analyticsCoordinator: FakeAnalyticsService(),
tokenActionsService: tokenActionsService,
walletConnectCoordinator: .fake(),
transactionsStorages: .init(),
coinTickersFetcher: CoinTickersFetcher(provider: AlphaWalletProviderFactory.makeProvider(), config: config),
activitiesService: FakeActivitiesService(),
walletBalanceCoordinator: FakeWalletBalanceCoordinator()
)
coordinator.start()
XCTAssertTrue(coordinator.navigationController.viewControllers[0] is TokensViewController)
}
}