Skip to content

Commit

Permalink
Adds unit test for cellForRow method for default searches section
Browse files Browse the repository at this point in the history
  • Loading branch information
DeluxeAlonso committed Sep 18, 2024
1 parent 5d06606 commit baf7d01
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,22 @@ final class SearchOptionsDataSourceTests: XCTestCase {
XCTAssertNotNil(cellForRow as? GenreSearchOptionTableViewCell)
}

func testCellForRowDefaultSearches() {
// Arrange
let tableView = UITableView()
tableView.register(cellType: DefaultSearchOptionTableViewCell.self)
viewModel.sectionAtIndexResult = .defaultSearches
viewModel.defaultSearchOptionsCells = [
DefaultSearchOptionCellViewModel(defaultSearchOption: .popular),
DefaultSearchOptionCellViewModel(defaultSearchOption: .topRated)
]
// Act
let cellForRow = dataSource.tableView(tableView, cellForRowAt: IndexPath(row: 0, section: 0))
// Assert
XCTAssertNotNil(cellForRow as? DefaultSearchOptionTableViewCell)
}


func testDidSelectMovie() {
// Act
dataSource.recentlyVisitedMoviesTableViewCell(RecentlyVisitedMoviesTableViewCell(), didSelectMovieAt: IndexPath(row: 0, section: 0))
Expand Down

0 comments on commit baf7d01

Please sign in to comment.