Last active
January 11, 2020 15:47
-
-
Save giovani-pereira-ifood/682c38c547b435183300aa58c8757cc0 to your computer and use it in GitHub Desktop.
mirror extension usage
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
class SceneCreatorTest: XCTestCase { | |
private let sut = SceneCreator() | |
func test_presentersViewShouldBeTheSameAsCreatedScene() { | |
// Given | |
let scene = sut.createScene() | |
// When | |
let interactor = mirror(property: .interactor, ofType: Interactor.self, from: scene) | |
let presenter = mirror(property: .presenter, ofType: Presenter.self, from: interactor) | |
let presentersView = mirror(property: .viewController, ofType: ViewController.self, from: presenter) | |
//Then | |
XCTAssertNotNil(presentersView) // Check if there is a view on the presenter | |
XCTAssertTrue(presentersView === scene) // and if its the same as `scene` | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment