Build errors with XCTests

I am trying to run XCTests in Xcode 7 for a model class that uses ESTBeaconManager and ESTBeaconManagerDelegate. It’s a Swift project. I followed your guide to import the EstimoteSDK and add the bridging header.

Running the project on the simulator as well as on the device works just fine. Only when running the tests for this class I get a couple of errors that hinder me running the tests:

Use of undeclared type ‘ESTBeaconManagerDelegate’…
Use of undeclared type ‘ESTBeaconManager’…

I wondered, is this a general issue with testing model classes that use the EstimoteSDK/ESTBeaconManager (or is it just me…)?

Have you added the bridging header to your project settings, or app target settings? If the latter, then you’ll also need to add it to the test target. Or just do it globally, for the project (:

Note that if you’re using CocoaPods to manage dependencies, you’ll need to make sure to add EstimoteSDK to the test target as well. My favorite solution here is to set the test target’s configuration to the same one as the main target, as described here: