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.
TableView section one tests
From the course: iOS App Development: Test-Driven Development
TableView section one tests
- [Instructor] OK, with the foundation of our data service all set up, we can move on to actually testing and implementing our table view functionality. In our Test Folder, I'm going to make a new group, going to call this Test Data Service, and inside this new folder, I'm going to create a new file, Unit Test Case Class, and I'm going to name it MovieLibraryDataServiceTests. Now let's add our @testable import at the top of the file, and let's delete the default functions from the body. Now the most basic test we can write at this point is to check that our table view always has two sections, one for movies to see, and one for movies we've already seen. I'm going to add a problem mark, just going to call this one Sections, and start a new test. Func testTableViewSections_Count_ReturnsTwo. Inside the test, we need two things, an instance of our new data service and a table view. Let's start let dataService equals a new instance of our MovieLibraryDataService, and let tableView equals…
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)
-
-