 import DBNetworkStack
 import Sourcing
 
-func testResource<T>(elements: [T]) -> Resource<Array<T>> {
-    let url: URL! = URL(string: "bahn.de")
-    let request = URLRequest(url: url)
-    
-    return Resource(request: request, parse: { _ in return elements })
+extension Resource {
+    static func mockWith(result: Model) -> Resource<Model> {
+        let url: URL! = URL(string: "bahn.de")
+        let request = URLRequest(url: url)
+        
+        return Resource(request: request, parse: { _ in return result })
+    }
 }
 
 class ResourceDataProviderTests: XCTestCase {

    
    func testOnNetworkRequestCanceldWithEmptyData() {
        //Given
        let resource = testResource(elements: ["Result"])
        resourceDataProvider.reconfigure(with: resource)
        
        //When

    
    func testLoadResource_skipLoadingState() {
        //Given
        let resource = Resource.mockWith(result: ["Result"])
        
        //When
        resourceDataProvider.reconfigure(with: resource)
