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
From the course: iOS App Development: Test-Driven Development
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Interface testing setup5m 33s
-
(Locked)
Data source and delegate setup8m 1s
-
(Locked)
TableView section one tests8m 41s
-
(Locked)
TableView section two tests4m 10s
-
(Locked)
Mocking the TableView cell10m 22s
-
(Locked)
Configure the TableView cell12m 35s
-
(Locked)
Test cell selection11m 35s
-
(Locked)
-
-