Ready for use mock
ronanrodrigo opened this issue · 0 comments
ronanrodrigo commented
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)
}
}