Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ready for use mock #7

Open
ronanrodrigo opened this issue Jan 6, 2018 · 0 comments
Open

Ready for use mock #7

ronanrodrigo opened this issue Jan 6, 2018 · 0 comments

Comments

@ronanrodrigo
Copy link
Owner

It is nice to empower anyone to build their own mocks. But, I think that Frisbee must provide a ready for use mock. Something like that:

public class MockGetter<Entity: Decodable>: Getable {
    var resultOnComplete: Result<Entity>
    var didCallGet = false

    // ...

    public func get<Entity: Decodable>(url: String, onComplete: @escaping (Result<Entity>) -> Void) {
        didCallGet = true
        completionHandler(resultOnComplete)
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

1 participant