Write UI compnent tests with fakes.
- [Instructor] At this point, we've checked that our…number of rows in section one…is as it should be.…But we also have to account for the second section,…and we want to make sure that that's equal,…or returning, the movies seen array count.…Since the only entry point…to that functionality is by favoriting a movie…from our list,…we need to incorporate that into our test.…So, in movie library data provider test,…which is where we are right now,…make some room, and on line 48…func testRowCountInSectionTwo…_ShouldEqualMoviesSeenCount…In here, we're going to add two movies,…so sut.movieManager?.addMovie…say, Sci-fi.…
sut.movieManager? Add another movie,…call this Thriller.…We need to favorite the first one.…sut.movieManager?.favoriteMovieAtIndex…zero, which is the first movie we entered,…and now we can add our assertion,…so XCTAssertEqual(tableView.numberOfRows…in section two is equal to one.…
And we're going to do something similar…to what we did up here,…in our test row count in section one, and…we're going to now favorite…
- Test-driven development: history and theory
- Creating a data model test
- Expanding tests
- Testing class methods
- Checking for duplicates
- Testing table views
- Mocking cells
- Testing cell selection
- Assembling the app
Skill Level Intermediate
Distributing Your iOS App for Testing with TestFlightwith Ron Buencamino35m 10s Intermediate
1. Foundation and Theory
2. Data Models and the Manager Class
3. UITableView Testing
4. Finishing Touches and Xcode Features
- 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.