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 two tests
From the course: iOS App Development: Test-Driven Development
TableView section two tests
- [Instructor] Alright, so we've checked the number of rows in our first section and that's working perfectly. Now, we need to repeat that process and check for our second section number of rows. Since the only entry point into that functionality is by checking off a movie from our list, we need to incorporate that into our next test. So, let's start it off func testTable ViewSections SectionTwo ReturnsMovies SeenCount. Let's add a few movies to our movie manager. We're going to add fairyTale and I'm going to add darkComedy and now I'm going to check off movie at index zero. So, sut.movieManager, checkOffMovie index, zero, which is our fairy tale. Now, here's our first assertion, XCTAsstertEqual, that our libraryTableView .numberOfRows, inSection one, which is actually our second section, is equal to one after we check off a movie. Now, again we're going to add two blocks of code, each with an assertion here just like we did before, to mirror user input. So, let's check off another…
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)
-
-