         self.waitForExpectationsWithTimeout(1) { timeoutError in
             XCTAssertNil(timeoutError)
             
-            XCTAssertEqual(delegate.dataKeyedByTask[task1.taskIdentifier], body1)
-            XCTAssertEqual(delegate.dataKeyedByTask[task2.taskIdentifier], body2)
+            XCTAssertEqual(delegate.dataKeyedByTaskIdentifier[task1.taskIdentifier], body1)
+            XCTAssertEqual(delegate.dataKeyedByTaskIdentifier[task2.taskIdentifier], body2)
         }
     }
     

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

        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)
        }
    }
    
