Comparing objects directly in Swift requires a specific protocol implementation. In this video, review how to subscribe your Movie data model to the Equatable protocol and add its required equivalence method.
- [Instructor] We're at a good place to stop for a second…and take a look at the console panel…and unpack some of the logs we've been getting…now that we have a growing test suite.…So I'm going to drag up and expand to the side…and scroll to the top.…Now here we'll see that our latest test run…produced a log for each test function we wrote…as well as how long each took.…At the bottom of the log…you'll find a more condensed summary…of each Swift test file we have…with how many failures each one had and their test duration.…Finally, there's a directory path…to where the test session log is stored on your hard drive…if you ever need it.…
Now that that's out of the way,…let's revisit our movie struct test file.…One of the last things we need to do…is update our movie struct so that we can directly compare…movie instances and their properties.…So let's start a new test function here,…func testEquatable_ReturnsTrue.…Inside the body, we just want to compare…two movies with the same titles,…and we're going to use a new assertion to test that comparison.…
- 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
Advanced iOS Development: Working with APIswith Saul Mora1h 59m Intermediate
Designing iOS and Android Appswith Renata Phillippi1h 6m 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.