add test for StaticCursor

This commit is contained in:
Ivan Smolin 2017-05-11 13:15:12 +03:00
parent 10e459dd40
commit bd4d423aec
1 changed files with 17 additions and 0 deletions

View File

@ -85,4 +85,21 @@ class CursorTests: XCTestCase {
waitForExpectations(timeout: 10, handler: nil)
}
func testStaticCursor() {
let cursor = StaticCursor(content: Array(1...40).map(String.init))
let cursorExpectation = expectation(description: "Static cursor expectation")
cursor.loadNextBatch().subscribe(onSuccess: { loadedItems in
XCTAssertEqual(loadedItems.count, 40)
cursorExpectation.fulfill()
}) { error in
XCTFail(error.localizedDescription)
}
.addDisposableTo(disposeBag)
waitForExpectations(timeout: 10, handler: nil)
}
}