This file contains hidden or 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
| Next occurrence: option + control + E | |
| Previous occurrence: shift + option + control + E | |
| Edit in scrope: command + control + E | |
| Quick indent: control + I | |
| Move line up: option + command + [ | |
| Move line down: option + command + ] | |
| Multi-cursor: shift + control + click | |
| Multi-cursor up: shift + control + up | |
| Multi-cursor down: shift + control + up | |
| Move to cursor: option + command + L |
This file contains hidden or 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
| import XCTest | |
| class ContactUITests: XCTestCase { | |
| override func setUp() { | |
| continueAfterFailure = false | |
| XCUIApplication().launch() | |
| } | |
| func testContactFlow() { | |
| let app = XCUIApplication() |
This file contains hidden or 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
| func testLongText() { | |
| guard let viewModel = view?.viewModel as? MockContactViewModel else { | |
| XCTFail("Unit test should be using mock view model") | |
| return | |
| } | |
| guard let view = view as? ContactViewController else { | |
| XCTFail("Unit test should be using UIViewController") | |
| return | |
| } |
This file contains hidden or 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
| import Foundation | |
| import Swinject | |
| import FBSnapshotTestCase | |
| @testable import ContactApp | |
| class ContactSnapshotTests: FBSnapshotTestCase { | |
| var view: ContactViewable? | |
| override func setUp() { | |
| super.setUp() |
This file contains hidden or 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
| import XCTest | |
| import Swinject | |
| @testable import ContactApp | |
| class ContactNetworkUnitTests: XCTestCase { | |
| var provider: Providable? | |
| override func setUp() { | |
| super.setUp() | |
| provider = networkContainer.resolve(Providable.self) |
This file contains hidden or 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
| import XCTest | |
| import Swinject | |
| @testable import ContactApp | |
| class FavoriteMockUnitTests: XCTestCase { | |
| var view: FavoriteViewable? | |
| override func setUp() { | |
| super.setUp() | |
| view = mockContainer.resolve(FavoriteViewable.self) |
This file contains hidden or 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
| func testContactFail() { | |
| guard let view = view as? MockContactViewController else { | |
| XCTFail("Unit test should be using mock view controller") | |
| return | |
| } | |
| guard let favoriteViewModel = view.favoriteView?.viewModel else { | |
| XCTFail("Favorite view model isn't set") | |
| return | |
| } | |
| guard let provider = view.viewModel?.provider?.provider as? MockNetworkProvider else { |
This file contains hidden or 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
| func testContactAndImageRetrieved() { | |
| guard let view = view as? MockContactViewController else { | |
| XCTFail("Unit test should be using mock view controller") | |
| return | |
| } | |
| guard let favoriteViewModel = view.favoriteView?.viewModel else { | |
| XCTFail("Favorite view model isn't set") | |
| return | |
| } | |
| guard let provider = view.viewModel?.provider?.provider as? MockNetworkProvider else { |
This file contains hidden or 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
| import XCTest | |
| import Swinject | |
| @testable import ContactApp | |
| class ContactMockUnitTests: XCTestCase { | |
| var view: ContactViewable? | |
| override func setUp() { | |
| super.setUp() | |
| view = mockContainer.resolve(ContactViewable.self) |
This file contains hidden or 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
| import UIKit | |
| import RxCocoa | |
| @testable import ContactApp | |
| class MockContactViewModel: ContactViewModelable { | |
| var view: ContactViewable? | |
| var provider: ContactProvidable? | |
| var name = BehaviorRelay<String?>(value: nil) | |
| var description = BehaviorRelay<String?>(value: nil) |
NewerOlder