Created
July 25, 2018 16:28
-
-
Save andru255/96e1cc466719165e4296b9bee417885b 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
class BooksTests: QuickSpec { | |
override func spec() { | |
describe("Book") { | |
let adapter = NetworkAdapter() | |
let mockFinder = MockBookFinder(adapter: adapter) | |
it("MockBookFinder.searchBy success") { | |
var wasSuccess = false | |
mockFinder.searchBy(author: "jhon doe", success: { data in | |
wasSuccess = true | |
}) | |
expect(wasSuccess).toEventually(equal(true)) | |
} | |
it("MockBookFinder.searchBy error") { | |
var wasFail = false | |
mockFinder.searchByFail(author: "jhon doe", fail: { _ in | |
wasFail = true | |
}) | |
expect(wasFail).toEventually(equal(true)) | |
} | |
it("MockBookFinder.getTotalSearch") { | |
expect(mockFinder.getTotalSearch()).to(equal(2)) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment