Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pzmudzinski/cf56ebb86055abd2304905f2eb6aa0e1 to your computer and use it in GitHub Desktop.
Save pzmudzinski/cf56ebb86055abd2304905f2eb6aa0e1 to your computer and use it in GitHub Desktop.
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