Skip to content

Commit

Permalink
Merge pull request #970 from DeluxeAlonso/feature/code-cleanup
Browse files Browse the repository at this point in the history
Feature/code cleanup
  • Loading branch information
DeluxeAlonso authored Sep 3, 2024
2 parents e3f345c + fcb7432 commit 3820df4
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ enum LocalizedStrings: String, Localizable {
case collapseMovieCellsHint

case topRatedMoviesTitle
case topRatedMoviesSubtitle
case popularMoviesTitle
case popularMoviesSubtitle
case similarMoviesTitle

case cast
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ enum DefaultSearchOption {
var subtitle: String? {
switch self {
case .popular:
return "The hottest movies on the internet"
return LocalizedStrings.popularMoviesSubtitle()
case .topRated:
return "The top rated movies on the internet"
return LocalizedStrings.topRatedMoviesSubtitle()
}
}

Expand Down
2 changes: 2 additions & 0 deletions UpcomingMovies/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@
"collapseMovieCellsHint" = "Collapse movies";

"topRatedMoviesTitle" = "Top Rated Movies";
"topRatedMoviesSubtitle" = "The top rated movies on the internet";
"popularMoviesTitle" = "Popular Movies";
"popularMoviesSubtitle" = "The hottest movies on the internet";
"similarMoviesTitle" = "Similar Movies";

"cast" = "Cast";
Expand Down
2 changes: 2 additions & 0 deletions UpcomingMovies/es-419.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@
"collapseMovieCellsHint" = "Colapsar películas";

"topRatedMoviesTitle" = "Películas Top";
"topRatedMoviesSubtitle" = "Las películas mejores puntuadas del internet";
"popularMoviesTitle" = "Películas Populares";
"popularMoviesSubtitle" = "Las películas más buscadas del internet";
"similarMoviesTitle" = "Películas Similares";

"cast" = "Reparto";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,39 @@ final class DefaultSearchOptionTests: XCTestCase {
XCTAssertEqual(title, "Popular Movies")
}

func testPopularSubtitle() {
// Act
let subtitle = DefaultSearchOption.popular.subtitle
// Assert
XCTAssertEqual(subtitle, "The hottest movies on the internet")
}

func testPopularIcon() {
// Act
let icon = DefaultSearchOption.popular.icon
// Assert
XCTAssertEqual(icon, #imageLiteral(resourceName: "Popular"))
}

func testTopRatedTitle() {
// Act
let title = DefaultSearchOption.topRated.title
// Assert
XCTAssertEqual(title, "Top Rated Movies")
}

func testTopRatedSubtitle() {
// Act
let subtitle = DefaultSearchOption.topRated.subtitle
// Assert
XCTAssertEqual(subtitle, "The top rated movies on the internet")
}

func testTopRatedIcon() {
// Act
let icon = DefaultSearchOption.topRated.icon
// Assert
XCTAssertEqual(icon, #imageLiteral(resourceName: "TopRated"))
}

}

0 comments on commit 3820df4

Please sign in to comment.