         XCTAssertEqual(operation.previousServerChangeToken, token)
         XCTAssertEqual(operation.resultsLimit, resultsLimit)
         XCTAssertEqual(operation.desiredKeys!, keys)
+        XCTAssertEqual(operation.recordZoneID, zoneID)
+        XCTAssertNotNil(operation.recordChangedBlock)
+        XCTAssertNotNil(operation.recordWithIDWasDeletedBlock)
+    }
+
+    func test__execution_after_cancellation() {
+        operation.cancel()
+        waitForOperation(operation)
+
+        XCTAssertTrue(operation.finished)
+        XCTAssertTrue(operation.cancelled)
     }
 
     func test__success_without_completion_block() {

        XCTAssertTrue(operation.finished)
    }
    
//    func test__success_with_completion_block() {
//
//    }

}








    }
}

class CloudKitOperationModifyBadgeCompletionTests: CKTests {

    var badgeValue: Int = 6
    var operation: CloudKitOperation<TestModifyBadgeOperation>!

    override func setUp() {
        super.setUp()
        operation = CloudKitOperation(reachability: reachability) { TestModifyBadgeOperation() }
        operation.badgeValue = badgeValue
    }

    func test__execution_after_cancellation() {
        operation.cancel()
        waitForOperation(operation)

        XCTAssertTrue(operation.finished)
        XCTAssertTrue(operation.cancelled)
    }

    func test__success_without_completion_block() {
        waitForOperation(operation)
        XCTAssertTrue(operation.finished)
        XCTAssertEqual(operation.badgeValue, badgeValue)
    }

    func test__success_with_completion_block() {
        operation.setModifyBadgeCompletionBlock { _ in }
        waitForOperation(operation)
        XCTAssertTrue(operation.finished)
        XCTAssertEqual(operation.errors.count, 0)
    }

    func test__error_without_completion_block() {
        operation = CloudKitOperation(reachability: reachability) {
            let op = TestModifyBadgeOperation()
            op.error = NSError(domain: CKErrorDomain, code: CKErrorCode.InternalError.rawValue, userInfo: nil)
            return op
        }

        waitForOperation(operation)
        XCTAssertTrue(operation.finished)
        XCTAssertEqual(operation.errors.count, 0)
    }

    func test__error_with_completion_block() {
        operation = CloudKitOperation(reachability: reachability) {
            let op = TestModifyBadgeOperation()
            op.error = NSError(domain: CKErrorDomain, code: CKErrorCode.InternalError.rawValue, userInfo: nil)
            return op
        }
        operation.setModifyBadgeCompletionBlock { _ in }

        waitForOperation(operation)
        XCTAssertTrue(operation.finished)
        XCTAssertEqual(operation.errors.count, 1)
    }
}

class CloudKitOperationFetchRecordChangesTests: CKTests {

    var container: TestFetchRecordChangesOperation.Container!
    var db: TestFetchRecordChangesOperation.Database!
    var token: TestFetchRecordChangesOperation.ServerChangeToken!
    var resultsLimit: Int = 0
    var keys: [String]!
    var zoneID: TestFetchRecordChangesOperation.RecordZoneID!
    var operation: CloudKitOperation<TestFetchRecordChangesOperation>!

    override func setUp() {
        super.setUp()
        container = "I'm a test container!"
        db = "I'm a test database!"
        token = "I'm a server token"
        resultsLimit = 10
        keys = [ "desired-key-1",  "desired-key-2" ]
        zoneID = "I'm a zone id"
        operation = CloudKitOperation(reachability: reachability) { TestFetchRecordChangesOperation() }
        operation.container = container
        operation.database = db
        operation.previousServerChangeToken = token
        operation.resultsLimit = resultsLimit
        operation.desiredKeys = keys
        operation.recordZoneID = zoneID
        operation.recordChangedBlock = { _ in }
        operation.recordWithIDWasDeletedBlock = { _ in }
    }

    func test__setting_common_properties() {

        waitForOperation(operation)
        XCTAssertTrue(operation.finished)
