From bd4d423aec5510292d69b1bb6100b704cb6311c4 Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Thu, 11 May 2017 13:15:12 +0300 Subject: [PATCH] add test for StaticCursor --- LeadKit/Tests/CursorTests.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/LeadKit/Tests/CursorTests.swift b/LeadKit/Tests/CursorTests.swift index 9e425804..fdb6e08c 100644 --- a/LeadKit/Tests/CursorTests.swift +++ b/LeadKit/Tests/CursorTests.swift @@ -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) + } + }