Challenge: Make Course Implement Equatable

You have implemented several tests (testCourseInitialization(), testCreateCourseFromValidDictionary(), testResultFromValidHTTPResponseAndValidData(_:), testFetcherSuccess()) that compare the properties of Course objects to determine that they are equal. Make Course adopt the Equatable protocol allowing instances of Course to be compared. Take advantage of this by using XCTAssertEqual in your tests.

To make Course adopt Equatable you will need to implement a free function with this signature:

 ​ ​ ​ ​p​u​b​l​i​c​ ​f​u​n​c​ ​=​=​(​l​h​s​:​ ​C​o​u​r​s​e​,​ ​r​h​s​:​ ​C​o​u​r​s​e​)​ ​-​>​ ​B​o​o​l​

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.