We have two sections in our TableView, which means that we need to expand our tests to include the second section initial state and property values. In this video, walk through expanding the TableView test cases and necessary refactoring for cleaner code.
- [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 movie…with our movie manager…and this time, we're going to again check…
- What is test-driven development?
- Creating and expanding a data model
- Creating a manager class
- Testing class methods
- Checking for duplicates
- Testing table views
- Mocking cells
- Testing cell selection
- Assembling the app
Skill Level Intermediate
1. Foundation and Theory
2. Getting Started
3. The Manager Class
4. TableView Testing
5. Finishing Touches
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.