Last active
July 13, 2017 12:41
-
-
Save arthur-here/1b61e406a38ed07f12e0084a59a299b4 to your computer and use it in GitHub Desktop.
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
func test_SelectRepository_EmitsShowRepository() { | |
let repositoryToSelect = RepositoryViewModel(repository: testRepository) | |
// Create fake observable which fires at 300 | |
let selectRepositoryObservable = testScheduler.createHotObservable([next(300, repositoryToSelect)]) | |
// Bind fake observable to the input | |
selectRepositoryObservable | |
.bind(to: viewModel.selectRepository) | |
.disposed(by: disposeBag) | |
// Subscribe on the showRepository output and start testScheduler | |
let result = testScheduler.start { self.viewModel.showRepository.map { $0.absoluteString } } | |
// Assert that emitted url es equal to the expected one | |
XCTAssertEqual(result.events, [next(300, "https://www.apple.com")]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment