             }
             onCompletion(result)
         }
-        onTypedSucess = { anyResult in
+        onTypedSuccess = { anyResult in
             guard let typedResult =  anyResult as? T.Model else {
                 fatalError("Extected type of \(T.Model.self)")
             }

public class NetworkServiceMock: NetworkServiceProviding {
    private var onErrorCallback: ((DBNetworkStackError) -> Void)?
    private var onSuccess: ((Data) -> Void)?
    private var onTypedSucess: ((Any) -> Void)?
    
    public init() {}
    
    /// Count of all stared requests
    public var requestCount: Int = 0
    /// Last executed request
    public var lastReuqest: NetworkRequestRepresening?
    /// Set this to hava a custom networktask
    public var nextNetworkTask: NetworkTaskRepresenting?

    @discardableResult
    public func request<T: ResourceModeling>(_ resource: T, onCompletion: @escaping (T.Model) -> Void,
                 onError: @escaping (DBNetworkStackError) -> Void) -> NetworkTaskRepresenting {
        lastReuqest = resource.request
        requestCount += 1
        onSuccess = { data in
            guard let result = try? resource.parse(data) else {

        }
        onErrorCallback = nil
        onSuccess = nil
        onTypedSuccess = nil
    }
    
    /// Will return a successful request, by using the given data as a server response.
    ///
    /// - Parameters:
    ///   - data: the mock response from the server. `Data()` by default
