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.

Interface testing setup

Interface testing setup

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

Start my 1-month free trial

Interface testing setup

- [Instructor] Let's start off our view controller test by making ourselves a brand new test class. In our test folder, under Test Controllers, I'm going to right-click, and add a new file. And we want this to be a unit test case class. We're going to call this library view controller tests. Now we need our testable import, so let's add that at the top, and delete our two default functions. Now a good habit to get into when testing view controllers, is to start by checking that the components we're going to need are not nil. So the first test we're going to write here is to check that we have a table view on our library view controller. I'm going to make myself some room, and on line 24, I'm going to write a new pragma mark, for this section called Nil Checks. Let's also start off our first function. Func, test library V-C, underscore, table view should not be nil. Now as we learned in our last section, the best way to go about organizing a new test class, is to declare a system under…

Contents