From 974615ba415549faf201d7d1c11132972ae83a65 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Tue, 28 Nov 2023 11:07:27 +0000 Subject: [PATCH] Fix Swift 5.8 warnings --- Tests/TMDbTests/Movies/MovieServiceTests.swift | 6 +++--- Tests/TMDbTests/TVEpisodes/TVEpisodeServiceTests.swift | 4 ++-- Tests/TMDbTests/TVSeasons/TVSeasonServiceTests.swift | 4 ++-- Tests/TMDbTests/TVSeries/TVSeriesServiceTests.swift | 6 +++--- .../WatchProviders/WatchProviderServiceTests.swift | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Tests/TMDbTests/Movies/MovieServiceTests.swift b/Tests/TMDbTests/Movies/MovieServiceTests.swift index 0bb645f4..f729d765 100644 --- a/Tests/TMDbTests/Movies/MovieServiceTests.swift +++ b/Tests/TMDbTests/Movies/MovieServiceTests.swift @@ -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 ) } @@ -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 ) } @@ -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) } diff --git a/Tests/TMDbTests/TVEpisodes/TVEpisodeServiceTests.swift b/Tests/TMDbTests/TVEpisodes/TVEpisodeServiceTests.swift index 2866a15a..3dfcae0c 100644 --- a/Tests/TMDbTests/TVEpisodes/TVEpisodeServiceTests.swift +++ b/Tests/TMDbTests/TVEpisodes/TVEpisodeServiceTests.swift @@ -84,7 +84,7 @@ final class TVEpisodeServiceTests: XCTestCase { tvSeriesID: tvSeriesID, seasonNumber: seasonNumber, episodeNumber: episodeNumber, - languageCode: locale.languageCode + languageCode: locale.language.languageCode?.identifier ).path ) } @@ -109,7 +109,7 @@ final class TVEpisodeServiceTests: XCTestCase { tvSeriesID: tvSeriesID, seasonNumber: seasonNumber, episodeNumber: episodeNumber, - languageCode: locale.languageCode + languageCode: locale.language.languageCode?.identifier ).path ) } diff --git a/Tests/TMDbTests/TVSeasons/TVSeasonServiceTests.swift b/Tests/TMDbTests/TVSeasons/TVSeasonServiceTests.swift index 3146e92d..9a5ddb0b 100644 --- a/Tests/TMDbTests/TVSeasons/TVSeasonServiceTests.swift +++ b/Tests/TMDbTests/TVSeasons/TVSeasonServiceTests.swift @@ -68,7 +68,7 @@ final class TVSeasonServiceTests: XCTestCase { TVSeasonsEndpoint.images( tvSeriesID: tvSeriesID, seasonNumber: seasonNumber, - languageCode: locale.languageCode + languageCode: locale.language.languageCode?.identifier ).path ) } @@ -87,7 +87,7 @@ final class TVSeasonServiceTests: XCTestCase { TVSeasonsEndpoint.videos( tvSeriesID: tvSeriesID, seasonNumber: seasonNumber, - languageCode: locale.languageCode + languageCode: locale.language.languageCode?.identifier ).path ) } diff --git a/Tests/TMDbTests/TVSeries/TVSeriesServiceTests.swift b/Tests/TMDbTests/TVSeries/TVSeriesServiceTests.swift index 7e0a01bf..31f96353 100644 --- a/Tests/TMDbTests/TVSeries/TVSeriesServiceTests.swift +++ b/Tests/TMDbTests/TVSeries/TVSeriesServiceTests.swift @@ -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 ) } @@ -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 ) } @@ -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) } diff --git a/Tests/TMDbTests/WatchProviders/WatchProviderServiceTests.swift b/Tests/TMDbTests/WatchProviders/WatchProviderServiceTests.swift index c357bdca..e6a7c295 100644 --- a/Tests/TMDbTests/WatchProviders/WatchProviderServiceTests.swift +++ b/Tests/TMDbTests/WatchProviders/WatchProviderServiceTests.swift @@ -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 { @@ -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) } }