Skip to content

Commit

Permalink
Fix Swift 5.8 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
adamayoung committed Nov 28, 2023
1 parent 3c4ff6b commit 974615b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Tests/TMDbTests/Movies/MovieServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ final class MovieServiceTests: XCTestCase {
XCTAssertEqual(result, expectedResult)
XCTAssertEqual(
apiClient.lastPath,
MoviesEndpoint.images(movieID: movieID, languageCode: locale.languageCode).path
MoviesEndpoint.images(movieID: movieID, languageCode: locale.language.languageCode?.identifier).path
)
}

Expand All @@ -120,7 +120,7 @@ final class MovieServiceTests: XCTestCase {
XCTAssertEqual(result, expectedResult)
XCTAssertEqual(
apiClient.lastPath,
MoviesEndpoint.videos(movieID: movieID, languageCode: locale.languageCode).path
MoviesEndpoint.videos(movieID: movieID, languageCode: locale.language.languageCode?.identifier).path
)
}

Expand Down Expand Up @@ -323,7 +323,7 @@ final class MovieServiceTests: XCTestCase {

let result = try await service.watchProviders(forMovie: movieID)

let regionCode = try XCTUnwrap(locale.regionCode)
let regionCode = try XCTUnwrap(locale.region?.identifier)
XCTAssertEqual(result, expectedResult.results[regionCode])
XCTAssertEqual(apiClient.lastPath, MoviesEndpoint.watch(movieID: movieID).path)
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/TMDbTests/TVEpisodes/TVEpisodeServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ final class TVEpisodeServiceTests: XCTestCase {
tvSeriesID: tvSeriesID,
seasonNumber: seasonNumber,
episodeNumber: episodeNumber,
languageCode: locale.languageCode
languageCode: locale.language.languageCode?.identifier
).path
)
}
Expand All @@ -109,7 +109,7 @@ final class TVEpisodeServiceTests: XCTestCase {
tvSeriesID: tvSeriesID,
seasonNumber: seasonNumber,
episodeNumber: episodeNumber,
languageCode: locale.languageCode
languageCode: locale.language.languageCode?.identifier
).path
)
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/TMDbTests/TVSeasons/TVSeasonServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ final class TVSeasonServiceTests: XCTestCase {
TVSeasonsEndpoint.images(
tvSeriesID: tvSeriesID,
seasonNumber: seasonNumber,
languageCode: locale.languageCode
languageCode: locale.language.languageCode?.identifier
).path
)
}
Expand All @@ -87,7 +87,7 @@ final class TVSeasonServiceTests: XCTestCase {
TVSeasonsEndpoint.videos(
tvSeriesID: tvSeriesID,
seasonNumber: seasonNumber,
languageCode: locale.languageCode
languageCode: locale.language.languageCode?.identifier
).path
)
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/TMDbTests/TVSeries/TVSeriesServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ final class TVSeriesServiceTests: XCTestCase {
XCTAssertEqual(result, expectedResult)
XCTAssertEqual(
apiClient.lastPath,
TVSeriesEndpoint.images(tvSeriesID: tvSeriesID, languageCode: locale.languageCode).path
TVSeriesEndpoint.images(tvSeriesID: tvSeriesID, languageCode: locale.language.languageCode?.identifier).path
)
}

Expand All @@ -120,7 +120,7 @@ final class TVSeriesServiceTests: XCTestCase {
XCTAssertEqual(result, expectedResult)
XCTAssertEqual(
apiClient.lastPath,
TVSeriesEndpoint.videos(tvSeriesID: tvSeriesID, languageCode: locale.languageCode).path
TVSeriesEndpoint.videos(tvSeriesID: tvSeriesID, languageCode: locale.language.languageCode?.identifier).path
)
}

Expand Down Expand Up @@ -230,7 +230,7 @@ final class TVSeriesServiceTests: XCTestCase {

let result = try await service.watchProviders(forTVSeries: tvSeriesID)

let regionCode = try XCTUnwrap(locale.regionCode)
let regionCode = try XCTUnwrap(locale.region?.identifier)
XCTAssertEqual(result, expectedResult.results[regionCode])
XCTAssertEqual(apiClient.lastPath, TVSeriesEndpoint.watch(tvSeriesID: tvSeriesID).path)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ final class WatchProviderServiceTests: XCTestCase {
let result = try await service.movieWatchProviders()

XCTAssertEqual(result, expectedResult)
XCTAssertEqual(apiClient.lastPath, WatchProviderEndpoint.movie(regionCode: locale.regionCode).path)
XCTAssertEqual(apiClient.lastPath, WatchProviderEndpoint.movie(regionCode: locale.region?.identifier).path)
}

func testTVSeriesWatchProvidersReturnsWatchProviders() async throws {
Expand All @@ -70,7 +70,7 @@ final class WatchProviderServiceTests: XCTestCase {
let result = try await service.tvSeriesWatchProviders()

XCTAssertEqual(result, expectedResult)
XCTAssertEqual(apiClient.lastPath, WatchProviderEndpoint.tvSeries(regionCode: locale.regionCode).path)
XCTAssertEqual(apiClient.lastPath, WatchProviderEndpoint.tvSeries(regionCode: locale.region?.identifier).path)
}

}

0 comments on commit 974615b

Please sign in to comment.