         }
         future.onFailure {error in
             onFailureExpectation.fulfill()
-            XCTAssert(error.code == CharacteristicError.WriteNotSupported.rawValue, "Error code invalid")
+            XCTAssertEqual(error.code, CharacteristicError.WriteNotSupported.rawValue, "Error code invalid")
             XCTAssertFalse(self.mockPerpheral.writeValueCalled, "writeValue called")
         }
         waitForExpectationsWithTimeout(120) {error in

        future.onSuccess {_ in
            onSuccessExpectation.fulfill()
            XCTAssert(self.mockPerpheral.setNotifyValueCalled, "setNotifyValue not called")
            XCTAssert(self.mockPerpheral.setNotifyValueCount == 1, "setNotifyValue not called once")
            if let state = self.mockPerpheral.notifyingState {
                XCTAssert(state, "setNotifyValue state not true")
            } else {

        }
        future.onFailure {error in
            onFailureExpectation.fulfill()
            XCTAssert(self.mockPerpheral.setNotifyValueCalled, "setNotifyValue not called")
            XCTAssertEqual(error.code, TestFailure.error.code, "Error code invalid")
            XCTAssertEqual(self.mockPerpheral.setNotifyValueCount, 1, "setNotifyValueCount not called 1 time")
            if let state = self.mockPerpheral.notifyingState {
                XCTAssert(state, "setNotifyValue state not true")
            } else {
