Implementing tests for Snippets
Now that we've cut our teeth on unit testing in Xcode, let's apply our new skills back in our Snippets
application. In this section, we'll learn how to set up unit tests in an existing project that didn't start with testing targets, and then write some tests for our application to ensure everything is working as expected.
Setting up the Snippets project
Setting up our project with unit tests is relatively simple. Since we're starting out without anything, we're going to need to create a new unit testing target, and then make sure all of our build settings are set properly:
To begin, open up the test navigator, and then, from the plus button at the bottom (Figure 13.11), choose new Unit Test Target…. From there, we'll give the new target a name of SnippetsTests
, and set the project to be Snippets
and the target to be tested as Snippets
(see Figure 13...