November 2018
Intermediate to advanced
404 pages
10h 16m
English
The following diagram illustrates how you can build a test using the XCTest framework in Swift:

When running tests, XCTest finds all the test classes in our application. Each test class is a subclass of XCTestCase [1]. XCTest runs the setUp() method [2] and then all of the class's test methods.
Each test method [3] that implements a test always has the prefix test, takes no parameters, and returns no values. A test method may have an optional block called addTeardownBlock(_:) for us to add additional cleanup code. This is useful if we need to destroy a resource created locally in the test method.
If XCTest runs ...
Read now
Unlock full access