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

TableView section two tests

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

Start my 1-month free trial

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…

Contents