From the course: iOS App Development: Test-Driven Development

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Wrap up the movie manager

Wrap up the movie manager

From the course: iOS App Development: Test-Driven Development

Start my 1-month free trial

Wrap up the movie manager

- [Instructor] While we're here in the MovieStructTests, I'm going to add two pragma MARKs to keep things organized. So at the top of our Init functions, I'm going to add two forward slashes and our MARK keyword, and just put this as Initialization section. The start of our equatable section, I'm going to do the same thing, and save it off. Now if we look at our MovieManager, it's almost finished, but there are two critical things it still can't handle: clearing out our movie arrays, and checking for duplicate entries. So in our MovieManagerTests, let's add a new function called func testClearArrays_ReturnsArrayCountsOfZero, and here let's add a couple movies to our library, addMovie, scifi, and addMovie, action. Let's checkOffMovie at index 0, which is going to be our scifi, and add some assertions. So XCTAssertEqual, and we want to check that our moviesToSeeCount is now equal to 1, and we need another assertion, XCTAssertEqual, and we're going to say sut.moviesSeenCount is also…

Contents