Created
November 14, 2018 21:46
-
-
Save pzmudzinski/cf56ebb86055abd2304905f2eb6aa0e1 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 testDeleteCommandRemovesItemFromCollection() { | |
let itemsObserver = testScheduler.createObserver([Book].self) | |
viewModel.items.bind(to: itemsObserver) | |
.disposed(by: disposeBag) | |
testScheduler.createHotObservable( | |
[Recorded.next(100, IndexPath(row: 0, section: 0))] | |
) | |
.bind(to: viewModel.deleteCommand) | |
.disposed(by: disposeBag) | |
testScheduler.start() | |
XCTAssertRecordedElements( | |
itemsObserver.events, | |
[ | |
[Book(title: "Book 1"), Book(title: "Book 2"), Book(title: "Book 3")], | |
[Book(title: "Book 2"), Book(title: "Book 3")] | |
] | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment