         }
         future.onFailure {error in
             onFailureExpectation.fulfill()
-            XCTAssert(error.code == BCError.peripheralDisconnected.code, "Error code invalid")
+            XCTAssertEqual(error.code, BCError.peripheralDisconnected.code, "Error code invalid")
+            XCTAssertEqual(mockPeripheral.discoverServicesCalledCount, 0, "CBPeripheral#discoverServices called more than once")
             XCTAssertFalse(mockPeripheral.discoverServicesCalled, "CBPeripheral#discoverServices called")
-            XCTAssert(mockPeripheral.discoverServicesCalledCount == 0, "CBPeripheral#discoverServices called more than once")
             XCTAssertFalse(mockPeripheral.discoverCharacteristicsCalled, "CBPeripheral#discoverChracteristics called")
         }
         waitForExpectationsWithTimeout(2) {error in

        }
        future.onFailure {error in
            onFailureExpectation.fulfill()
            XCTAssert(error.code == TestFailure.error.code, "Error code invalid")
            XCTAssert(mockPeripheral.discoverServicesCalled, "CBPeripheral#discoverServices not called")
        }
        peripheral.didDiscoverServices(self.mockServices, error:nil)

        }
        future.onFailure {error in
            onFailureExpectation.fulfill()
            XCTAssertEqual(error.code, TestFailure.error.code, "Error code invalid")
            XCTAssert(mockPeripheral.discoverServicesCalled, "CBPeripheral#discoverServices not called")
        }
        peripheral.didDiscoverServices(self.mockServices, error:TestFailure.error)
