Using protocols to make unit testing more efficient.
- [Instructor] One of the last things we need to do…is update our movie struct so that we can directly compare…the movie instances and their properties.…Let's start by writing the first test right here.…We're going to go to our movie struct test,…make some new space, and on line 34,…we're going to write another test.…So func, test movies are equal should return true.…Which means that if we give it two movies…with the same titles we should get a passing test.…
Let's try it.…Movie one equals movie.…We're going to call it action.…Let movie two, we're going to also call this action.…We're going to use a new kind of assertion…called XC test assert equal…and pass in movie one and movie two as the parameters.…If you save it and run, we'll see what happens.…Okay, cannot invoke XC test assert equal…with an argument list of type, movie and movie.…
Now, this means that XC test assert equal…can only be used on instances that conform…to the equatable protocol.…For the movie struct to do that, we need to implement…the equivalence operator function that the protocol…
- 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?
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.