         }
         onErrorCallback = nil
         onSuccess = nil
-        onTypedSucess = nil
+        onTypedSuccess = nil
     }
     
-    /// Will return a sucessful request, by using the given data as a server response.
+    /// 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

        }
        onErrorCallback = nil
        onSuccess = nil
        onTypedSucess = nil
    }
    
    /// Will return a sucessful request, by using the given type `T` as serialized result of a request.
    ///
    /// **Warning:** This will crash if type `T` does not match your expected ResponseType of your current request
    ///
    /// - Parameters:
    ///   - data: the mock response from the server. `Data()` by default
    ///   - count: the count how often the response gets triggerd. 1 by default
    public func returnSucess<T>(with serializedResponse: T, count: Int = 1) {
        for _ in 0...count {
            onTypedSucess?(serializedResponse)
        }
        onErrorCallback = nil
        onSuccess = nil
        onTypedSucess = nil
    }
}

public class NetworkServiceMock: NetworkServiceProviding {
    private var onErrorCallback: ((DBNetworkStackError) -> Void)?
    private var onSuccess: ((Data) -> Void)?
    private var onTypedSuccess: ((Any) -> Void)?
    
    public init() {}
    
    /// Count of all started requests
    public var requestCount: Int = 0
    /// Last executed request
    public var lastRequest: 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 {
        lastRequest = resource.request
        requestCount += 1
        onSuccess = { data in
            guard let result = try? resource.parse(data) else {
