Unit tests in action
Let's get started with writing our first unit tests in Xcode. First, we'll start off in a clean project while we learn the basics, and then later on we'll integrate unit testing into our Snippets
project.
In this section, we'll start by learning how to set up a project with unit testing capabilities. Then we'll take a look at how to write a unit test using the XCTest
framework. Finally, we'll take a look at how to run our tests and measure their results.
Setting up the project
Time to set up a new project, you know the drill. But not so fast! This time we're going to be exploring the last two settings that we haven't yet used in the project creation process: the Include Unit Tests and Include UI Tests options (seen in Figure 13.1):
Checking off these two boxes will make sure that the new project you're about to create will have all of the necessary...