         onSuccess = nil
         onTypedSucess = nil
     }
-    
-    public func returnSucess<Resource: ResourceModeling>(with resource: Resource, data: Data, count: Int = 1) {
-        returnSucess(with: try! resource.parse(data))
-    }
 }

    private var onSuccess: ((Data) -> Void)?
    private var onTypedSucess: ((Any) -> Void)?
    
    public var requestCount: Int = 0
    public var lastReuqest: NetworkRequestRepresening?

    public func request<T: ResourceModeling>(_ resource: T, onCompletion: @escaping (T.Model) -> Void,
                 onError: @escaping (DBNetworkStackError) -> Void) -> NetworkTaskRepresenting {
        lastReuqest = resource.request
        onSuccess = { data in
             onCompletion(try! resource.parse(data))
        }
        onTypedSucess = { anyResult in
            guard let typedResult =  anyResult as? T.Model else {

        onSuccess = 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 yount 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)
