Closed philips77 closed 4 years ago
This PR also fixes Unit Tests. However, they will only work on a simulator, as the mock/native implementation is chosen based on whether targetEnvironment
is simulator
. The setUp()
method in XCTestCase
is called after the central manager is instantiated, so setting the flag in there does not work in the sample app.
This PR improves
tearDownSimulation()
method added in #18. It is not required to tear down the test before starting a new one. The manager may be powered off usingCBMCentralManagerMock.simulatePowerOff()
, which allows to set new test peripheral specifications. Tearing down will invalidate all current instances ofCBMCentralManagerMock
, so new instances will have to be created.