Adding a Unit Testing target to your app
In order to be able to test the JournalEntry
class, you’ll add a Unit Testing target to your app. You will be able to write all the tests for classes in your app here. Follow these steps:
- In Xcode, choose File | New | Target to open the template selector.
- iOS should already be selected. In the Test section, click Unit Testing Bundle and click Next:
Figure 25.1: Template chooser window
- In the Choose options for your new target: window, leave all the options at their default values and click Finish:
Figure 25.2: Options window
- Verify that the JRNLTests folder is visible in the Project navigator:
Figure 25.3: Project navigator showing JRNLTests folder
You have successfully added the Unit Testing target to your app! In the next section, you’ll write some tests to ensure that the JournalEntry
class works as it should.