From the course: iOS App Development: Test-Driven Development

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Test case breakdown

Test case breakdown

From the course: iOS App Development: Test-Driven Development

Start my 1-month free trial

Test case breakdown

- [Instructor] Our basic data type in this course is going to be a movie structure. Now, I've gone with a struct here instead of a class because our movie objects are really simple, only having a title and an optional release date, and they also need to be value types. Before we get into all that, let's take a look at the default test case that Xcode created for us. Here in our FilmTests folder, go down to the FilmFestTest.swift file. The basic anatomy of an XCTest case is pretty straightforward. At the top of the file, we have the framework import which gives us access to all the functionality we'll need to write our tests and a really important line, the @testable import. This is going to let our test classes communicate with our actual application code, so it's crucial that we don't forget to add this when creating new scripts. Now, in the body of the class, you can see that up first, we have a setUp method. This is going to run before each test method in the class is executed. We…

Contents