From the course: iOS App Development: Test-Driven Development
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Data source and delegate setup
From the course: iOS App Development: Test-Driven Development
Data source and delegate setup
- [Instructor] Alright, for the rest of this section we're going to focus on testing our table view. Since we're aiming to be good software developers, we're going to decouple the data source and delegate into a separate class. But first let's make ourself a new pragma mark underneath the nil checks and name this one Data Source. Let's also start a new test function and we're going to call this testDataSource_viewDidLoad_SetsTableViewDataSource. Inside the test, we're going to assert that our data source is not nil and that it's of type MovieLibraryDataService, which is going to be our decoupled class. So let's say XCTAssertNotNil, and we're going to use our sut library table view data source. And we're also going to say XCTAssertTrue, that sub.librarytableview.datasource is of type MovieLibraryDataService. And we're going to get our first error here because our data service class doesn't exist yet. So let's go into our film fest folder, right click, and select New Group. Go ahead and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Interface testing setup5m 33s
-
(Locked)
Data source and delegate setup8m 1s
-
(Locked)
TableView section one tests8m 41s
-
(Locked)
TableView section two tests4m 10s
-
(Locked)
Mocking the TableView cell10m 22s
-
(Locked)
Configure the TableView cell12m 35s
-
(Locked)
Test cell selection11m 35s
-
(Locked)
-
-