Created
April 30, 2019 20:34
-
-
Save volkanbicer/723184172a5c0e5f0bbe0bc206802e4a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 MockBookService: BookService { | |
func fetchPopularBooks(then handler: (Books) -> Void) { | |
let books = [ | |
Book(id: "1", name: "X", author: "X"), | |
Book(id: "2", name: "Y", author: "Y"), | |
Book(id: "3", name: "Z", author: "Z") | |
] | |
handler(books) | |
} | |
func fetchRelatedBooks(then handler: (Books) -> Void) { | |
let books = [ | |
Book(id: "4", name: "A", author: "A"), | |
Book(id: "5", name: "B", author: "B"), | |
Book(id: "6", name: "C", author: "C") | |
] | |
handler(books) | |
} | |
} | |
class MockAuth: Auth { | |
var isAuthenticated: Bool { | |
return Bool.random() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment