Skip to content

Instantly share code, notes, and snippets.

@volkanbicer
Created April 30, 2019 20:34
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 volkanbicer/723184172a5c0e5f0bbe0bc206802e4a to your computer and use it in GitHub Desktop.
Save volkanbicer/723184172a5c0e5f0bbe0bc206802e4a to your computer and use it in GitHub Desktop.
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