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.

Create the movie manager

Create the movie manager

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

Start my 1-month free trial

Create the movie manager

- [Instructor] Now that we have our simple movie data model, we can move into creating the movie manager class. And that's going to handle all of our business logic. Let's go into our test folder and our test models right click and create a new file. You want ios selected, unit test case class. We're going to call this movie manager tests. Make sure this is in our test models folder and hit create. Let's get in the habit of adding our testable import at the top and we'll save that. Now our movie manager is only going to be concerned with keeping track of a few variables. Mainly the number of movies we want to see. And the number of movies we've already been to. Now the tests we're going to write will make sure that these variables are both set to zero when starting up our app. So let's delete our default test examples and start off with one of our own. Func testInit underscore and here it's going to be movies to see returns zero. Again good test naming is important for your own sake…

Contents