 private class SessionTestDelegate: NSObject, NSURLSessionDataDelegate {
     var expectations: [XCTestExpectation]
     
-    var dataKeyedByTask : [Int : NSMutableData] = [:]
-    var response : NSURLResponse?
+    var dataKeyedByTaskIdentifier : [Int : NSMutableData] = [:]
+    var responseKeyedByTaskIdentifier : [Int : NSURLResponse] = [:]
     
     init(expectations: [XCTestExpectation]) {
         self.expectations = expectations
     }
     
     @objc func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveResponse response: NSURLResponse, completionHandler: (NSURLSessionResponseDisposition) -> Void) {
-        self.response = response
+        self.responseKeyedByTaskIdentifier[dataTask.taskIdentifier] = response
     }
     
     @objc func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData recievedData: NSData) {
-        var data = dataKeyedByTask[dataTask.taskIdentifier]
+        var data = dataKeyedByTaskIdentifier[dataTask.taskIdentifier]
         
         if data == nil {
             data = NSMutableData()
-            dataKeyedByTask[dataTask.taskIdentifier] = data
+            dataKeyedByTaskIdentifier[dataTask.taskIdentifier] = data
         }
         
         data!.appendData(recievedData)

            XCTAssertNil(timeoutError)

            // Sanity it's actually mocked
            XCTAssertEqual(delegate.dataKeyedByTask[task1.taskIdentifier], body)
            
            // Check the delay
            let interval = -start.timeIntervalSinceNow

        self.waitForExpectationsWithTimeout(1) { timeoutError in
            XCTAssertNil(timeoutError)
            
            XCTAssertEqual(delegate.dataKeyedByTaskIdentifier[task1.taskIdentifier], body)
            XCTAssertEqual(delegate.dataKeyedByTaskIdentifier[task2.taskIdentifier], body)
            XCTAssertEqual(delegate.dataKeyedByTaskIdentifier[task3.taskIdentifier], body)
        }
    }
    
