diff --git a/src/libs/Trakt.NET/Enums/TraktExtendedInfo.cs b/src/libs/Trakt.NET/Enums/TraktExtendedInfo.cs index f3a7d74b0..3e718432f 100644 --- a/src/libs/Trakt.NET/Enums/TraktExtendedInfo.cs +++ b/src/libs/Trakt.NET/Enums/TraktExtendedInfo.cs @@ -9,30 +9,33 @@ [Flags] public enum TraktExtendedInfo { - /// No additional data should be retrieved. + /// No additional data shall be retrieved. [TraktEnumMember(JsonValue = "")] None = 0, - /// Metadata information should be retrieved. + /// Metadata information shall be retrieved. Metadata = 1, - /// Full information for media objects should be retrieved. + /// Full information for media objects shall be retrieved. Full = 2, - /// No seasons information should be retrieved. + /// No seasons information shall be retrieved. [TraktEnumMember(JsonValue = "noseasons")] NoSeasons = 4, - /// Episodes information should be retrieved. + /// Episodes information shall be retrieved. Episodes = 8, - /// Guest stars information should be retrieved. + /// Guest stars information shall be retrieved. GuestStars = 16, - /// Comment media object information should be retrieved. + /// Comment media object information shall be retrieved. Comments = 32, - /// User VIP information should be retrieved. - VIP = 64 + /// User VIP information shall be retrieved. + VIP = 64, + + /// Media images shall be retrieved. + Images = 128 } } diff --git a/src/libs/Trakt.NET/Internal/Json/SerializerContexts/EpisodesJsonSerializerContext.cs b/src/libs/Trakt.NET/Internal/Json/SerializerContexts/EpisodesJsonSerializerContext.cs index 7a2cfd794..52f3bef29 100644 --- a/src/libs/Trakt.NET/Internal/Json/SerializerContexts/EpisodesJsonSerializerContext.cs +++ b/src/libs/Trakt.NET/Internal/Json/SerializerContexts/EpisodesJsonSerializerContext.cs @@ -6,9 +6,15 @@ namespace TraktNET { [ExcludeFromCodeCoverage] [JsonSerializable(typeof(TraktEpisode))] + [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktEpisodeIDs))] + [JsonSerializable(typeof(IReadOnlyList))] + [JsonSerializable(typeof(TraktEpisodeImages))] + [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktEpisodeMinimal))] + [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktEpisodeTranslation))] + [JsonSerializable(typeof(IReadOnlyList))] public sealed partial class EpisodesJsonSerializerContext : JsonSerializerContext { } diff --git a/src/libs/Trakt.NET/Internal/Json/SerializerContexts/JsonSerializerContextFactory.cs b/src/libs/Trakt.NET/Internal/Json/SerializerContexts/JsonSerializerContextFactory.cs index 92b3d4dfd..adcba06f4 100644 --- a/src/libs/Trakt.NET/Internal/Json/SerializerContexts/JsonSerializerContextFactory.cs +++ b/src/libs/Trakt.NET/Internal/Json/SerializerContexts/JsonSerializerContextFactory.cs @@ -150,6 +150,7 @@ internal static JsonSerializerContext GetContext() { typeof(TraktEpisode), typeof(TraktEpisodeIDs), + typeof(TraktEpisodeImages), typeof(TraktEpisodeMinimal), typeof(TraktEpisodeTranslation) }); @@ -186,6 +187,7 @@ internal static JsonSerializerContext GetContext() typeof(TraktMovie), typeof(TraktMovieAlias), typeof(TraktMovieIDs), + typeof(TraktMovieImages), typeof(TraktMovieMinimal), typeof(TraktMovieRelease), typeof(TraktMovieStatistics), @@ -198,6 +200,7 @@ internal static JsonSerializerContext GetContext() { typeof(TraktPerson), typeof(TraktPersonIDs), + typeof(TraktPersonImages), typeof(TraktPersonMinimal), typeof(TraktPersonSocialIDs) }); @@ -206,6 +209,7 @@ internal static JsonSerializerContext GetContext() { typeof(TraktSeason), typeof(TraktSeasonIDs), + typeof(TraktSeasonImages), typeof(TraktSeasonMinimal) }); @@ -214,6 +218,7 @@ internal static JsonSerializerContext GetContext() typeof(TraktShow), typeof(TraktShowAirs), typeof(TraktShowIDs), + typeof(TraktShowImages), typeof(TraktShowMinimal) }); @@ -264,6 +269,7 @@ internal static JsonSerializerContext GetContext() private static readonly HashSet s_episodeJsonTypes = [ typeof(TraktEpisode), typeof(TraktEpisodeIDs), + typeof(TraktEpisodeImages), typeof(TraktEpisodeMinimal), typeof(TraktEpisodeTranslation) ]; @@ -297,6 +303,7 @@ internal static JsonSerializerContext GetContext() typeof(TraktMovie), typeof(TraktMovieAlias), typeof(TraktMovieIDs), + typeof(TraktMovieImages), typeof(TraktMovieMinimal), typeof(TraktMovieRelease), typeof(TraktMovieStatistics), @@ -308,6 +315,7 @@ internal static JsonSerializerContext GetContext() private static readonly HashSet s_peopleJsonTypes = [ typeof(TraktPerson), typeof(TraktPersonIDs), + typeof(TraktPersonImages), typeof(TraktPersonMinimal), typeof(TraktPersonSocialIDs) ]; @@ -315,6 +323,7 @@ internal static JsonSerializerContext GetContext() private static readonly HashSet s_seasonsJsonTypes = [ typeof(TraktSeason), typeof(TraktSeasonIDs), + typeof(TraktSeasonImages), typeof(TraktSeasonMinimal) ]; @@ -322,6 +331,7 @@ internal static JsonSerializerContext GetContext() typeof(TraktShow), typeof(TraktShowAirs), typeof(TraktShowIDs), + typeof(TraktShowImages), typeof(TraktShowMinimal) ]; diff --git a/src/libs/Trakt.NET/Internal/Json/SerializerContexts/MoviesJsonSerializerContext.cs b/src/libs/Trakt.NET/Internal/Json/SerializerContexts/MoviesJsonSerializerContext.cs index 7f9628ca5..457dce065 100644 --- a/src/libs/Trakt.NET/Internal/Json/SerializerContexts/MoviesJsonSerializerContext.cs +++ b/src/libs/Trakt.NET/Internal/Json/SerializerContexts/MoviesJsonSerializerContext.cs @@ -25,11 +25,14 @@ namespace TraktNET [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktMovieIDs))] [JsonSerializable(typeof(IReadOnlyList))] + [JsonSerializable(typeof(TraktMovieImages))] + [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktMovieMinimal))] [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktMovieRelease))] [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktMovieStatistics))] + [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktMovieTranslation))] [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktTrendingMovie))] diff --git a/src/libs/Trakt.NET/Internal/Json/SerializerContexts/PeopleJsonSerializerContext.cs b/src/libs/Trakt.NET/Internal/Json/SerializerContexts/PeopleJsonSerializerContext.cs index e3f89c94f..90acc5320 100644 --- a/src/libs/Trakt.NET/Internal/Json/SerializerContexts/PeopleJsonSerializerContext.cs +++ b/src/libs/Trakt.NET/Internal/Json/SerializerContexts/PeopleJsonSerializerContext.cs @@ -6,9 +6,15 @@ namespace TraktNET { [ExcludeFromCodeCoverage] [JsonSerializable(typeof(TraktPerson))] + [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktPersonIDs))] + [JsonSerializable(typeof(IReadOnlyList))] + [JsonSerializable(typeof(TraktPersonImages))] + [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktPersonMinimal))] + [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktPersonSocialIDs))] + [JsonSerializable(typeof(IReadOnlyList))] public sealed partial class PeopleJsonSerializerContext : JsonSerializerContext { } diff --git a/src/libs/Trakt.NET/Internal/Json/SerializerContexts/SeasonsJsonSerializerContext.cs b/src/libs/Trakt.NET/Internal/Json/SerializerContexts/SeasonsJsonSerializerContext.cs index d3b413560..c3e1e61e2 100644 --- a/src/libs/Trakt.NET/Internal/Json/SerializerContexts/SeasonsJsonSerializerContext.cs +++ b/src/libs/Trakt.NET/Internal/Json/SerializerContexts/SeasonsJsonSerializerContext.cs @@ -6,8 +6,13 @@ namespace TraktNET { [ExcludeFromCodeCoverage] [JsonSerializable(typeof(TraktSeason))] + [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktSeasonIDs))] + [JsonSerializable(typeof(IReadOnlyList))] + [JsonSerializable(typeof(TraktSeasonImages))] + [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktSeasonMinimal))] + [JsonSerializable(typeof(IReadOnlyList))] public sealed partial class SeasonsJsonSerializerContext : JsonSerializerContext { } diff --git a/src/libs/Trakt.NET/Internal/Json/SerializerContexts/ShowsJsonSerializerContext.cs b/src/libs/Trakt.NET/Internal/Json/SerializerContexts/ShowsJsonSerializerContext.cs index 875b2f183..bf18a51e7 100644 --- a/src/libs/Trakt.NET/Internal/Json/SerializerContexts/ShowsJsonSerializerContext.cs +++ b/src/libs/Trakt.NET/Internal/Json/SerializerContexts/ShowsJsonSerializerContext.cs @@ -6,9 +6,15 @@ namespace TraktNET { [ExcludeFromCodeCoverage] [JsonSerializable(typeof(TraktShow))] + [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktShowAirs))] + [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktShowIDs))] + [JsonSerializable(typeof(IReadOnlyList))] + [JsonSerializable(typeof(TraktShowImages))] + [JsonSerializable(typeof(IReadOnlyList))] [JsonSerializable(typeof(TraktShowMinimal))] + [JsonSerializable(typeof(IReadOnlyList))] public sealed partial class ShowsJsonSerializerContext : JsonSerializerContext { } diff --git a/src/libs/Trakt.NET/Json/Episodes/TraktEpisodeImages.cs b/src/libs/Trakt.NET/Json/Episodes/TraktEpisodeImages.cs new file mode 100644 index 000000000..a7dfcb08b --- /dev/null +++ b/src/libs/Trakt.NET/Json/Episodes/TraktEpisodeImages.cs @@ -0,0 +1,9 @@ +namespace TraktNET +{ + /// A collection of Trakt episode image URLs. + public record class TraktEpisodeImages + { + /// A list of Screenshot image URLs. + public List? Screenshot { get; set; } + } +} diff --git a/src/libs/Trakt.NET/Json/Episodes/TraktEpisodeMinimal.cs b/src/libs/Trakt.NET/Json/Episodes/TraktEpisodeMinimal.cs index c8caad7a4..7d24dad31 100644 --- a/src/libs/Trakt.NET/Json/Episodes/TraktEpisodeMinimal.cs +++ b/src/libs/Trakt.NET/Json/Episodes/TraktEpisodeMinimal.cs @@ -21,6 +21,12 @@ public record class TraktEpisodeMinimal [JsonPropertyName("ids")] public TraktEpisodeIDs? IDs { get; set; } + /// + /// The collection of image URLs for the episode. + /// See also . + /// + public TraktEpisodeImages? Images { get; set; } + /// Gets a string representation of the episode. /// A string representation of the episode. public override string ToString() diff --git a/src/libs/Trakt.NET/Json/Movies/TraktMovieImages.cs b/src/libs/Trakt.NET/Json/Movies/TraktMovieImages.cs new file mode 100644 index 000000000..c1f4de7c5 --- /dev/null +++ b/src/libs/Trakt.NET/Json/Movies/TraktMovieImages.cs @@ -0,0 +1,24 @@ +namespace TraktNET +{ + /// A collection of Trakt movie image URLs. + public record class TraktMovieImages + { + /// A list of Fanart image URLs. + public List? Fanart { get; set; } + + /// A list of Poster image URLs. + public List? Poster { get; set; } + + /// A list of Logo image URLs. + public List? Logo { get; set; } + + /// A list of Clearart image URLs. + public List? Clearart { get; set; } + + /// A list of Banner image URLs. + public List? Banner { get; set; } + + /// A list of Thumbnail image URLs. + public List? Thumb { get; set; } + } +} diff --git a/src/libs/Trakt.NET/Json/Movies/TraktMovieMinimal.cs b/src/libs/Trakt.NET/Json/Movies/TraktMovieMinimal.cs index 69e6cb12b..84e87692a 100644 --- a/src/libs/Trakt.NET/Json/Movies/TraktMovieMinimal.cs +++ b/src/libs/Trakt.NET/Json/Movies/TraktMovieMinimal.cs @@ -18,6 +18,12 @@ public record class TraktMovieMinimal [JsonPropertyName("ids")] public TraktMovieIDs? IDs { get; set; } + /// + /// The collection of image URLs for the movie. + /// See also . + /// + public TraktMovieImages? Images { get; set; } + /// Gets a string representation of the movie. /// A string representation of the movie. public override string ToString() diff --git a/src/libs/Trakt.NET/Json/People/TraktPersonImages.cs b/src/libs/Trakt.NET/Json/People/TraktPersonImages.cs new file mode 100644 index 000000000..9a3e01054 --- /dev/null +++ b/src/libs/Trakt.NET/Json/People/TraktPersonImages.cs @@ -0,0 +1,12 @@ +namespace TraktNET +{ + /// A collection of Trakt person image URLs. + public record class TraktPersonImages + { + /// A list of Headshot image URLs. + public List? Headshot { get; set; } + + /// A list of Fanart image URLs. + public List? Fanart { get; set; } + } +} diff --git a/src/libs/Trakt.NET/Json/People/TraktPersonMinimal.cs b/src/libs/Trakt.NET/Json/People/TraktPersonMinimal.cs index d27ad5e4b..75e216131 100644 --- a/src/libs/Trakt.NET/Json/People/TraktPersonMinimal.cs +++ b/src/libs/Trakt.NET/Json/People/TraktPersonMinimal.cs @@ -14,5 +14,11 @@ public record class TraktPersonMinimal /// [JsonPropertyName("ids")] public TraktPersonIDs? IDs { get; set; } + + /// + /// The collection of image URLs for the person. + /// See also . + /// + public TraktPersonImages? Images { get; set; } } } diff --git a/src/libs/Trakt.NET/Json/Seasons/TraktSeasonImages.cs b/src/libs/Trakt.NET/Json/Seasons/TraktSeasonImages.cs new file mode 100644 index 000000000..9c7e78a10 --- /dev/null +++ b/src/libs/Trakt.NET/Json/Seasons/TraktSeasonImages.cs @@ -0,0 +1,12 @@ +namespace TraktNET +{ + /// A collection of Trakt season image URLs. + public record class TraktSeasonImages + { + /// A list of Poster image URLs. + public List? Poster { get; set; } + + /// A list of Thumbnail image URLs. + public List? Thumb { get; set; } + } +} diff --git a/src/libs/Trakt.NET/Json/Seasons/TraktSeasonMinimal.cs b/src/libs/Trakt.NET/Json/Seasons/TraktSeasonMinimal.cs index 3c8457d26..74064772e 100644 --- a/src/libs/Trakt.NET/Json/Seasons/TraktSeasonMinimal.cs +++ b/src/libs/Trakt.NET/Json/Seasons/TraktSeasonMinimal.cs @@ -14,5 +14,11 @@ public record class TraktSeasonMinimal /// [JsonPropertyName("ids")] public TraktSeasonIDs? IDs { get; set; } + + /// + /// The collection of image URLs for the season. + /// See also . + /// + public TraktSeasonImages? Images { get; set; } } } diff --git a/src/libs/Trakt.NET/Json/Shows/TraktShowImages.cs b/src/libs/Trakt.NET/Json/Shows/TraktShowImages.cs new file mode 100644 index 000000000..b36399eda --- /dev/null +++ b/src/libs/Trakt.NET/Json/Shows/TraktShowImages.cs @@ -0,0 +1,24 @@ +namespace TraktNET +{ + /// A collection of Trakt show image URLs. + public record class TraktShowImages + { + /// A list of Fanart image URLs. + public List? Fanart { get; set; } + + /// A list of Poster image URLs. + public List? Poster { get; set; } + + /// A list of Logo image URLs. + public List? Logo { get; set; } + + /// A list of Clearart image URLs. + public List? Clearart { get; set; } + + /// A list of Banner image URLs. + public List? Banner { get; set; } + + /// A list of Thumbnail image URLs. + public List? Thumb { get; set; } + } +} diff --git a/src/libs/Trakt.NET/Json/Shows/TraktShowMinimal.cs b/src/libs/Trakt.NET/Json/Shows/TraktShowMinimal.cs index cf8b31cd5..ad419c028 100644 --- a/src/libs/Trakt.NET/Json/Shows/TraktShowMinimal.cs +++ b/src/libs/Trakt.NET/Json/Shows/TraktShowMinimal.cs @@ -18,6 +18,12 @@ public record class TraktShowMinimal [JsonPropertyName("ids")] public TraktShowIDs? IDs { get; set; } + /// + /// The collection of image URLs for the show. + /// See also . + /// + public TraktShowImages? Images { get; set; } + /// Gets a string representation of the show. /// A string representation of the show. public override string ToString() diff --git a/src/tests/libs/JsonData/Episodes/episode.json b/src/tests/libs/JsonData/Episodes/episode_full.json similarity index 100% rename from src/tests/libs/JsonData/Episodes/episode.json rename to src/tests/libs/JsonData/Episodes/episode_full.json diff --git a/src/tests/libs/JsonData/Episodes/episode_full_images.json b/src/tests/libs/JsonData/Episodes/episode_full_images.json new file mode 100644 index 000000000..4cc786f30 --- /dev/null +++ b/src/tests/libs/JsonData/Episodes/episode_full_images.json @@ -0,0 +1,58 @@ +{ + "season": 1, + "number": 1, + "title": "Winter Is Coming", + "ids": { + "trakt": 73640, + "tvdb": 3254641, + "imdb": "tt1480055", + "tmdb": 63056, + "tvrage": null + }, + "number_abs": 1, + "overview": "Jon Arryn, the Hand of the King, is dead. King Robert Baratheon plans to ask his oldest friend, Eddard Stark, to take Jon's place. Across the sea, Viserys Targaryen plans to wed his sister to a nomadic warlord in exchange for an army.", + "rating": 8.08208, + "votes": 14619, + "comment_count": 38, + "first_aired": "2011-04-18T01:00:00.000Z", + "updated_at": "2024-03-22T18:44:49.000Z", + "available_translations": [ + "ar", + "bg", + "bs", + "ca", + "cs", + "da", + "de", + "el", + "en", + "es", + "fa", + "fi", + "fr", + "he", + "hu", + "it", + "ja", + "ko", + "nl", + "no", + "pl", + "pt", + "ro", + "ru", + "sk", + "sl", + "sv", + "tr", + "uk", + "zh" + ], + "runtime": 62, + "episode_type": "series_premiere", + "images": { + "screenshot": [ + "walter-r2.trakt.tv/images/episodes/000/073/640/screenshots/medium/66c1ba1793.jpg.webp" + ] + } +} diff --git a/src/tests/libs/JsonData/Episodes/episode_minimal_images.json b/src/tests/libs/JsonData/Episodes/episode_minimal_images.json new file mode 100644 index 000000000..8f6a7755e --- /dev/null +++ b/src/tests/libs/JsonData/Episodes/episode_minimal_images.json @@ -0,0 +1,17 @@ +{ + "season": 1, + "number": 1, + "title": "Winter Is Coming", + "ids": { + "trakt": 73640, + "tvdb": 3254641, + "imdb": "tt1480055", + "tmdb": 63056, + "tvrage": null + }, + "images": { + "screenshot": [ + "walter-r2.trakt.tv/images/episodes/000/073/640/screenshots/medium/66c1ba1793.jpg.webp" + ] + } +} diff --git a/src/tests/libs/JsonData/Episodes/episodeimages.json b/src/tests/libs/JsonData/Episodes/episodeimages.json new file mode 100644 index 000000000..41c960428 --- /dev/null +++ b/src/tests/libs/JsonData/Episodes/episodeimages.json @@ -0,0 +1,5 @@ +{ + "screenshot": [ + "walter-r2.trakt.tv/images/episodes/000/073/640/screenshots/medium/66c1ba1793.jpg.webp" + ] +} diff --git a/src/tests/libs/JsonData/Movies/movie.json b/src/tests/libs/JsonData/Movies/movie_full.json similarity index 100% rename from src/tests/libs/JsonData/Movies/movie.json rename to src/tests/libs/JsonData/Movies/movie_full.json diff --git a/src/tests/libs/JsonData/Movies/movie_full_images.json b/src/tests/libs/JsonData/Movies/movie_full_images.json new file mode 100644 index 000000000..a5be9ee6f --- /dev/null +++ b/src/tests/libs/JsonData/Movies/movie_full_images.json @@ -0,0 +1,94 @@ +{ + "title": "Guardians of the Galaxy Volume 3", + "year": 2023, + "ids": { + "trakt": 293990, + "slug": "guardians-of-the-galaxy-volume-3-2023", + "imdb": "tt6791350", + "tmdb": 447365 + }, + "tagline": "Once more with feeling.", + "overview": "Peter Quill, still reeling from the loss of Gamora, must rally his team around him to defend the universe along with protecting one of their own. A mission that, if not completed successfully, could quite possibly lead to the end of the Guardians as we know them.", + "released": "2023-05-05", + "runtime": 150, + "country": "us", + "trailer": "https://youtube.com/watch?v=AAE5VZktooM", + "homepage": "http://www.marvel.com/movies/guardians-of-the-galaxy-volume-3", + "status": "released", + "rating": 7.976602658788774, + "votes": 16925, + "comment_count": 170, + "updated_at": "2024-03-23T08:06:45.000Z", + "language": "en", + "languages": [ + "en" + ], + "available_translations": [ + "ar", + "bg", + "ca", + "cs", + "da", + "de", + "el", + "en", + "eo", + "es", + "fa", + "fi", + "fr", + "he", + "hr", + "hu", + "id", + "it", + "ja", + "ka", + "ko", + "lt", + "lv", + "my", + "nl", + "no", + "pl", + "pt", + "ro", + "ru", + "sk", + "sl", + "sr", + "sv", + "th", + "tr", + "uk", + "vi", + "zh" + ], + "genres": [ + "science-fiction", + "superhero", + "action", + "adventure" + ], + "certification": "PG-13", + "images": { + "fanart": [ + "walter-r2.trakt.tv/images/movies/000/293/990/fanarts/medium/2ea7854adf.jpg.webp" + ], + "poster": [ + "walter-r2.trakt.tv/images/movies/000/293/990/posters/thumb/61ceb0624b.jpg.webp" + ], + "logo": [ + "walter-r2.trakt.tv/images/movies/000/293/990/logos/medium/9021d3352d.png.webp" + ], + "clearart": [ + "walter-r2.trakt.tv/images/movies/000/293/990/cleararts/medium/719bb7c638.png.webp" + ], + "banner": [ + "walter-r2.trakt.tv/images/movies/000/293/990/banners/medium/aadecf57bf.jpg.webp" + ], + "thumb": [ + "walter-r2.trakt.tv/images/movies/000/293/990/thumbs/medium/6d944d9545.jpg.webp" + ] + } +} diff --git a/src/tests/libs/JsonData/Movies/movie_minimal_images.json b/src/tests/libs/JsonData/Movies/movie_minimal_images.json new file mode 100644 index 000000000..2ddcc80f1 --- /dev/null +++ b/src/tests/libs/JsonData/Movies/movie_minimal_images.json @@ -0,0 +1,30 @@ +{ + "title": "Guardians of the Galaxy Volume 3", + "year": 2023, + "ids": { + "trakt": 293990, + "slug": "guardians-of-the-galaxy-volume-3-2023", + "imdb": "tt6791350", + "tmdb": 447365 + }, + "images": { + "fanart": [ + "walter-r2.trakt.tv/images/movies/000/293/990/fanarts/medium/2ea7854adf.jpg.webp" + ], + "poster": [ + "walter-r2.trakt.tv/images/movies/000/293/990/posters/thumb/61ceb0624b.jpg.webp" + ], + "logo": [ + "walter-r2.trakt.tv/images/movies/000/293/990/logos/medium/9021d3352d.png.webp" + ], + "clearart": [ + "walter-r2.trakt.tv/images/movies/000/293/990/cleararts/medium/719bb7c638.png.webp" + ], + "banner": [ + "walter-r2.trakt.tv/images/movies/000/293/990/banners/medium/aadecf57bf.jpg.webp" + ], + "thumb": [ + "walter-r2.trakt.tv/images/movies/000/293/990/thumbs/medium/6d944d9545.jpg.webp" + ] + } +} diff --git a/src/tests/libs/JsonData/Movies/movieimages.json b/src/tests/libs/JsonData/Movies/movieimages.json new file mode 100644 index 000000000..11c833f1f --- /dev/null +++ b/src/tests/libs/JsonData/Movies/movieimages.json @@ -0,0 +1,20 @@ +{ + "fanart": [ + "walter-r2.trakt.tv/images/movies/000/293/990/fanarts/medium/2ea7854adf.jpg.webp" + ], + "poster": [ + "walter-r2.trakt.tv/images/movies/000/293/990/posters/thumb/61ceb0624b.jpg.webp" + ], + "logo": [ + "walter-r2.trakt.tv/images/movies/000/293/990/logos/medium/9021d3352d.png.webp" + ], + "clearart": [ + "walter-r2.trakt.tv/images/movies/000/293/990/cleararts/medium/719bb7c638.png.webp" + ], + "banner": [ + "walter-r2.trakt.tv/images/movies/000/293/990/banners/medium/aadecf57bf.jpg.webp" + ], + "thumb": [ + "walter-r2.trakt.tv/images/movies/000/293/990/thumbs/medium/6d944d9545.jpg.webp" + ] +} diff --git a/src/tests/libs/JsonData/People/person.json b/src/tests/libs/JsonData/People/person_full.json similarity index 100% rename from src/tests/libs/JsonData/People/person.json rename to src/tests/libs/JsonData/People/person_full.json diff --git a/src/tests/libs/JsonData/People/person_full_images.json b/src/tests/libs/JsonData/People/person_full_images.json new file mode 100644 index 000000000..a69b772f4 --- /dev/null +++ b/src/tests/libs/JsonData/People/person_full_images.json @@ -0,0 +1,32 @@ +{ + "name": "Bryan Cranston", + "ids": { + "trakt": 297737, + "slug": "bryan-cranston", + "imdb": "nm0186505", + "tmdb": 17419, + "tvrage": null + }, + "social_ids": { + "twitter": "BryanCranston", + "facebook": "thebryancranston", + "instagram": "bryancranston", + "wikipedia": null + }, + "biography": "Bryan Lee Cranston (born March 7, 1956) is an American actor, director, and producer who is mainly known for portraying Walter White in the AMC crime drama series Breaking Bad (2008–2013) and Hal in the Fox sitcom Malcolm in the Middle (2000–2006).", + "birthday": "1956-03-07", + "death": null, + "birthplace": "Hollywood, Los Angeles, California, USA", + "homepage": null, + "known_for_department": "acting", + "gender": "male", + "updated_at": "2024-03-22T08:01:24.000Z", + "images": { + "headshot": [ + "walter-r2.trakt.tv/images/people/000/297/737/headshots/thumb/ef96a1e565.jpg.webp" + ], + "fanart": [ + "walter-r2.trakt.tv/images/people/000/297/737/fanarts/medium/ec609f5bcc.jpg.webp" + ] + } +} diff --git a/src/tests/libs/JsonData/People/person_minimal_images.json b/src/tests/libs/JsonData/People/person_minimal_images.json new file mode 100644 index 000000000..ac50b2672 --- /dev/null +++ b/src/tests/libs/JsonData/People/person_minimal_images.json @@ -0,0 +1,18 @@ +{ + "name": "Bryan Cranston", + "ids": { + "trakt": 297737, + "slug": "bryan-cranston", + "imdb": "nm0186505", + "tmdb": 17419, + "tvrage": null + }, + "images": { + "headshot": [ + "walter-r2.trakt.tv/images/people/000/297/737/headshots/thumb/ef96a1e565.jpg.webp" + ], + "fanart": [ + "walter-r2.trakt.tv/images/people/000/297/737/fanarts/medium/ec609f5bcc.jpg.webp" + ] + } +} diff --git a/src/tests/libs/JsonData/People/personimages.json b/src/tests/libs/JsonData/People/personimages.json new file mode 100644 index 000000000..8a1e3832f --- /dev/null +++ b/src/tests/libs/JsonData/People/personimages.json @@ -0,0 +1,8 @@ +{ + "headshot": [ + "walter-r2.trakt.tv/images/people/000/297/737/headshots/thumb/ef96a1e565.jpg.webp" + ], + "fanart": [ + "walter-r2.trakt.tv/images/people/000/297/737/fanarts/medium/ec609f5bcc.jpg.webp" + ] +} diff --git a/src/tests/libs/JsonData/Seasons/season.json b/src/tests/libs/JsonData/Seasons/season_full.json similarity index 100% rename from src/tests/libs/JsonData/Seasons/season.json rename to src/tests/libs/JsonData/Seasons/season_full.json diff --git a/src/tests/libs/JsonData/Seasons/season_with_episodes.json b/src/tests/libs/JsonData/Seasons/season_full_episodes.json similarity index 100% rename from src/tests/libs/JsonData/Seasons/season_with_episodes.json rename to src/tests/libs/JsonData/Seasons/season_full_episodes.json diff --git a/src/tests/libs/JsonData/Seasons/season_full_episodes_images.json b/src/tests/libs/JsonData/Seasons/season_full_episodes_images.json new file mode 100644 index 000000000..5043c5402 --- /dev/null +++ b/src/tests/libs/JsonData/Seasons/season_full_episodes_images.json @@ -0,0 +1,148 @@ +{ + "number": 1, + "ids": { + "trakt": 3963, + "tvdb": 364731, + "tmdb": 3624, + "tvrage": null + }, + "rating": 8.96076, + "votes": 4970, + "episode_count": 10, + "aired_episodes": 10, + "title": "Season 1", + "overview": "Trouble is brewing in the Seven Kingdoms of Westeros.", + "first_aired": "2011-04-18T01:00:00.000Z", + "updated_at": "2024-03-23T06:24:59.000Z", + "network": "HBO", + "episodes": [ + { + "season": 1, + "number": 1, + "title": "Winter Is Coming", + "ids": { + "trakt": 73640, + "tvdb": 3254641, + "imdb": "tt1480055", + "tmdb": 63056, + "tvrage": null + } + }, + { + "season": 1, + "number": 2, + "title": "The Kingsroad", + "ids": { + "trakt": 73641, + "tvdb": 3436411, + "imdb": "tt1668746", + "tmdb": 63057, + "tvrage": null + } + }, + { + "season": 1, + "number": 3, + "title": "Lord Snow", + "ids": { + "trakt": 73642, + "tvdb": 3436421, + "imdb": "tt1829962", + "tmdb": 63058, + "tvrage": null + } + }, + { + "season": 1, + "number": 4, + "title": "Cripples, Bastards, and Broken Things", + "ids": { + "trakt": 73643, + "tvdb": 3436431, + "imdb": "tt1829963", + "tmdb": 63059, + "tvrage": null + } + }, + { + "season": 1, + "number": 5, + "title": "The Wolf and the Lion", + "ids": { + "trakt": 73644, + "tvdb": 3436441, + "imdb": "tt1829964", + "tmdb": 63060, + "tvrage": null + } + }, + { + "season": 1, + "number": 6, + "title": "A Golden Crown", + "ids": { + "trakt": 73645, + "tvdb": 3436451, + "imdb": "tt1837862", + "tmdb": 63061, + "tvrage": null + } + }, + { + "season": 1, + "number": 7, + "title": "You Win or You Die", + "ids": { + "trakt": 73646, + "tvdb": 3436461, + "imdb": "tt1837863", + "tmdb": 63062, + "tvrage": null + } + }, + { + "season": 1, + "number": 8, + "title": "The Pointy End", + "ids": { + "trakt": 73647, + "tvdb": 3360391, + "imdb": "tt1837864", + "tmdb": 63063, + "tvrage": null + } + }, + { + "season": 1, + "number": 9, + "title": "Baelor", + "ids": { + "trakt": 73648, + "tvdb": 4063481, + "imdb": "tt1851398", + "tmdb": 63064, + "tvrage": null + } + }, + { + "season": 1, + "number": 10, + "title": "Fire and Blood", + "ids": { + "trakt": 73649, + "tvdb": 4063491, + "imdb": "tt1851397", + "tmdb": 63065, + "tvrage": null + } + } + ], + "images": { + "poster": [ + "walter-r2.trakt.tv/images/seasons/000/003/963/posters/thumb/15e611179e.jpg.webp" + ], + "thumb": [ + "walter-r2.trakt.tv/images/seasons/000/003/963/thumbs/medium/6c996deed7.jpg.webp" + ] + } +} diff --git a/src/tests/libs/JsonData/Seasons/season_full_images.json b/src/tests/libs/JsonData/Seasons/season_full_images.json new file mode 100644 index 000000000..3512c3144 --- /dev/null +++ b/src/tests/libs/JsonData/Seasons/season_full_images.json @@ -0,0 +1,26 @@ +{ + "number": 1, + "ids": { + "trakt": 3963, + "tvdb": 364731, + "tmdb": 3624, + "tvrage": null + }, + "rating": 8.96076, + "votes": 4970, + "episode_count": 10, + "aired_episodes": 10, + "title": "Season 1", + "overview": "Trouble is brewing in the Seven Kingdoms of Westeros.", + "first_aired": "2011-04-18T01:00:00.000Z", + "updated_at": "2024-03-23T06:24:59.000Z", + "network": "HBO", + "images": { + "poster": [ + "walter-r2.trakt.tv/images/seasons/000/003/963/posters/thumb/15e611179e.jpg.webp" + ], + "thumb": [ + "walter-r2.trakt.tv/images/seasons/000/003/963/thumbs/medium/6c996deed7.jpg.webp" + ] + } +} diff --git a/src/tests/libs/JsonData/Seasons/season_minimal_images.json b/src/tests/libs/JsonData/Seasons/season_minimal_images.json new file mode 100644 index 000000000..df6c4bfd3 --- /dev/null +++ b/src/tests/libs/JsonData/Seasons/season_minimal_images.json @@ -0,0 +1,17 @@ +{ + "number": 1, + "ids": { + "trakt": 3963, + "tvdb": 364731, + "tmdb": 3624, + "tvrage": null + }, + "images": { + "poster": [ + "walter-r2.trakt.tv/images/seasons/000/003/963/posters/thumb/15e611179e.jpg.webp" + ], + "thumb": [ + "walter-r2.trakt.tv/images/seasons/000/003/963/thumbs/medium/6c996deed7.jpg.webp" + ] + } +} diff --git a/src/tests/libs/JsonData/Seasons/seasonimages.json b/src/tests/libs/JsonData/Seasons/seasonimages.json new file mode 100644 index 000000000..0890d2c27 --- /dev/null +++ b/src/tests/libs/JsonData/Seasons/seasonimages.json @@ -0,0 +1,8 @@ +{ + "poster": [ + "walter-r2.trakt.tv/images/seasons/000/003/963/posters/thumb/15e611179e.jpg.webp" + ], + "thumb": [ + "walter-r2.trakt.tv/images/seasons/000/003/963/thumbs/medium/6c996deed7.jpg.webp" + ] +} diff --git a/src/tests/libs/JsonData/Shows/show.json b/src/tests/libs/JsonData/Shows/show_full.json similarity index 100% rename from src/tests/libs/JsonData/Shows/show.json rename to src/tests/libs/JsonData/Shows/show_full.json diff --git a/src/tests/libs/JsonData/Shows/show_full_images.json b/src/tests/libs/JsonData/Shows/show_full_images.json new file mode 100644 index 000000000..bf8de4cb1 --- /dev/null +++ b/src/tests/libs/JsonData/Shows/show_full_images.json @@ -0,0 +1,112 @@ +{ + "title": "Game of Thrones", + "year": 2011, + "ids": { + "trakt": 1390, + "slug": "game-of-thrones", + "tvdb": 121361, + "imdb": "tt0944947", + "tmdb": 1399, + "tvrage": null + }, + "tagline": "Winter is coming.", + "overview": "Seven noble families fight for control of the mythical land of Westeros.", + "first_aired": "2011-04-18T01:00:00.000Z", + "airs": { + "day": "Sunday", + "time": "21:00", + "timezone": "America/New_York" + }, + "runtime": 57, + "certification": "TV-MA", + "network": "HBO", + "country": "us", + "trailer": "https://youtube.com/watch?v=KPLWWIOCOOQ", + "homepage": "http://www.hbo.com/game-of-thrones", + "status": "ended", + "rating": 8.933884809616755, + "votes": 129108, + "comment_count": 414, + "updated_at": "2024-03-23T06:26:48.000Z", + "language": "en", + "languages": [ + "en" + ], + "available_translations": [ + "ar", + "be", + "bg", + "bs", + "ca", + "cs", + "da", + "de", + "el", + "en", + "eo", + "es", + "et", + "fa", + "fi", + "fr", + "he", + "hr", + "hu", + "id", + "is", + "it", + "ja", + "ka", + "ko", + "lb", + "lt", + "lv", + "ml", + "nl", + "no", + "pl", + "pt", + "ro", + "ru", + "sk", + "sl", + "so", + "sr", + "sv", + "ta", + "th", + "tr", + "tw", + "uk", + "uz", + "vi", + "zh" + ], + "genres": [ + "fantasy", + "drama", + "action", + "adventure" + ], + "aired_episodes": 73, + "images": { + "fanart": [ + "walter-r2.trakt.tv/images/shows/000/001/390/fanarts/medium/76d5df8aed.jpg.webp" + ], + "poster": [ + "walter-r2.trakt.tv/images/shows/000/001/390/posters/thumb/93df9cd612.jpg.webp" + ], + "logo": [ + "walter-r2.trakt.tv/images/shows/000/001/390/logos/medium/13b614ad43.png.webp" + ], + "clearart": [ + "walter-r2.trakt.tv/images/shows/000/001/390/cleararts/medium/5cbde9e647.png.webp" + ], + "banner": [ + "walter-r2.trakt.tv/images/shows/000/001/390/banners/medium/9fefff703d.jpg.webp" + ], + "thumb": [ + "walter-r2.trakt.tv/images/shows/000/001/390/thumbs/medium/7beccbd5a1.jpg.webp" + ] + } +} diff --git a/src/tests/libs/JsonData/Shows/show_minimal_images.json b/src/tests/libs/JsonData/Shows/show_minimal_images.json new file mode 100644 index 000000000..9bb51d921 --- /dev/null +++ b/src/tests/libs/JsonData/Shows/show_minimal_images.json @@ -0,0 +1,32 @@ +{ + "title": "Game of Thrones", + "year": 2011, + "ids": { + "trakt": 1390, + "slug": "game-of-thrones", + "tvdb": 121361, + "imdb": "tt0944947", + "tmdb": 1399, + "tvrage": null + }, + "images": { + "fanart": [ + "walter-r2.trakt.tv/images/shows/000/001/390/fanarts/medium/76d5df8aed.jpg.webp" + ], + "poster": [ + "walter-r2.trakt.tv/images/shows/000/001/390/posters/thumb/93df9cd612.jpg.webp" + ], + "logo": [ + "walter-r2.trakt.tv/images/shows/000/001/390/logos/medium/13b614ad43.png.webp" + ], + "clearart": [ + "walter-r2.trakt.tv/images/shows/000/001/390/cleararts/medium/5cbde9e647.png.webp" + ], + "banner": [ + "walter-r2.trakt.tv/images/shows/000/001/390/banners/medium/9fefff703d.jpg.webp" + ], + "thumb": [ + "walter-r2.trakt.tv/images/shows/000/001/390/thumbs/medium/7beccbd5a1.jpg.webp" + ] + } +} diff --git a/src/tests/libs/JsonData/Shows/showimages.json b/src/tests/libs/JsonData/Shows/showimages.json new file mode 100644 index 000000000..ee938758e --- /dev/null +++ b/src/tests/libs/JsonData/Shows/showimages.json @@ -0,0 +1,20 @@ +{ + "fanart": [ + "walter-r2.trakt.tv/images/shows/000/001/390/fanarts/medium/76d5df8aed.jpg.webp" + ], + "poster": [ + "walter-r2.trakt.tv/images/shows/000/001/390/posters/thumb/93df9cd612.jpg.webp" + ], + "logo": [ + "walter-r2.trakt.tv/images/shows/000/001/390/logos/medium/13b614ad43.png.webp" + ], + "clearart": [ + "walter-r2.trakt.tv/images/shows/000/001/390/cleararts/medium/5cbde9e647.png.webp" + ], + "banner": [ + "walter-r2.trakt.tv/images/shows/000/001/390/banners/medium/9fefff703d.jpg.webp" + ], + "thumb": [ + "walter-r2.trakt.tv/images/shows/000/001/390/thumbs/medium/7beccbd5a1.jpg.webp" + ] +} diff --git a/src/tests/libs/Trakt.NET.Core.Tests/Enums/TraktExtendedInfoTests.cs b/src/tests/libs/Trakt.NET.Core.Tests/Enums/TraktExtendedInfoTests.cs index bb4f3067e..7d76a14e8 100644 --- a/src/tests/libs/Trakt.NET.Core.Tests/Enums/TraktExtendedInfoTests.cs +++ b/src/tests/libs/Trakt.NET.Core.Tests/Enums/TraktExtendedInfoTests.cs @@ -13,6 +13,7 @@ public void TestTraktExtendedInfoToJson() TraktExtendedInfo.GuestStars.ToJson().ShouldBe("guest_stars"); TraktExtendedInfo.Comments.ToJson().ShouldBe("comments"); TraktExtendedInfo.VIP.ToJson().ShouldBe("vip"); + TraktExtendedInfo.Images.ToJson().ShouldBe("images"); } [Fact] @@ -26,6 +27,7 @@ public void TestTraktExtendedInfoFromJson() "guest_stars".ToTraktExtendedInfo().ShouldBe(TraktExtendedInfo.GuestStars); "comments".ToTraktExtendedInfo().ShouldBe(TraktExtendedInfo.Comments); "vip".ToTraktExtendedInfo().ShouldBe(TraktExtendedInfo.VIP); + "images".ToTraktExtendedInfo().ShouldBe(TraktExtendedInfo.Images); string? nullValue = null; nullValue.ToTraktExtendedInfo().ShouldBe(TraktExtendedInfo.None); @@ -42,10 +44,14 @@ public void TestTraktExtendedInfoDisplayName() TraktExtendedInfo.GuestStars.DisplayName().ShouldBe("Guest Stars"); TraktExtendedInfo.Comments.DisplayName().ShouldBe("Comments"); TraktExtendedInfo.VIP.DisplayName().ShouldBe("VIP"); + TraktExtendedInfo.Images.DisplayName().ShouldBe("Images"); TraktExtendedInfo fullAndVIP = TraktExtendedInfo.Full | TraktExtendedInfo.VIP; fullAndVIP.DisplayName().ShouldBe("Full, VIP"); + TraktExtendedInfo fullAndImages = TraktExtendedInfo.Full | TraktExtendedInfo.Images; + fullAndImages.DisplayName().ShouldBe("Full, Images"); + TraktExtendedInfo fullAndComments = TraktExtendedInfo.Full | TraktExtendedInfo.Comments; fullAndComments.DisplayName().ShouldBe("Full, Comments"); @@ -64,10 +70,14 @@ public void TestTraktExtendedInfoAsQuery() TraktExtendedInfo.GuestStars.AsQuery().ShouldBe("extended=guest_stars"); TraktExtendedInfo.Comments.AsQuery().ShouldBe("extended=comments"); TraktExtendedInfo.VIP.AsQuery().ShouldBe("extended=vip"); + TraktExtendedInfo.Images.AsQuery().ShouldBe("extended=images"); TraktExtendedInfo fullAndVIP = TraktExtendedInfo.Full | TraktExtendedInfo.VIP; fullAndVIP.AsQuery().ShouldBe("extended=full,vip"); + TraktExtendedInfo fullAndImages = TraktExtendedInfo.Full | TraktExtendedInfo.Images; + fullAndImages.AsQuery().ShouldBe("extended=full,images"); + TraktExtendedInfo fullAndComments = TraktExtendedInfo.Full | TraktExtendedInfo.Comments; fullAndComments.AsQuery().ShouldBe("extended=full,comments"); diff --git a/src/tests/libs/Trakt.NET.Json.Tests/Episodes/TraktEpisodeImagesTests.cs b/src/tests/libs/Trakt.NET.Json.Tests/Episodes/TraktEpisodeImagesTests.cs new file mode 100644 index 000000000..76ec815f5 --- /dev/null +++ b/src/tests/libs/Trakt.NET.Json.Tests/Episodes/TraktEpisodeImagesTests.cs @@ -0,0 +1,25 @@ +namespace TraktNET.Json.Episodes +{ + public sealed class TraktEpisodeImagesTests + { + [Fact] + public void TestTraktEpisodeImagesConstructor() + { + var episodeImages = new TraktEpisodeImages(); + + episodeImages.Screenshot.ShouldBeNull(); + } + + [Fact] + public async Task TestTraktEpisodeImagesFromJson() + { + TraktEpisodeImages? episodeImages = await TestUtility.DeserializeJsonAsync("Episodes\\episodeimages.json"); + + episodeImages.ShouldNotBeNull(); + + episodeImages!.Screenshot.ShouldNotBeNull(); + episodeImages!.Screenshot!.Count.ShouldBe(1); + episodeImages!.Screenshot!.ShouldBe([ "walter-r2.trakt.tv/images/episodes/000/073/640/screenshots/medium/66c1ba1793.jpg.webp" ]); + } + } +} diff --git a/src/tests/libs/Trakt.NET.Json.Tests/Episodes/TraktEpisodeTests.cs b/src/tests/libs/Trakt.NET.Json.Tests/Episodes/TraktEpisodeTests.cs index 1ece6b18d..9b9bde0ff 100644 --- a/src/tests/libs/Trakt.NET.Json.Tests/Episodes/TraktEpisodeTests.cs +++ b/src/tests/libs/Trakt.NET.Json.Tests/Episodes/TraktEpisodeTests.cs @@ -49,9 +49,81 @@ public async Task TestTraktEpisodeFromJsonMinimal() } [Fact] - public async Task TestTraktEpisodeFromJson() + public async Task TestTraktEpisodeFromJsonMinimalWithImages() { - TraktEpisode? episode = await TestUtility.DeserializeJsonAsync("Episodes\\episode.json"); + TraktEpisodeMinimal? episode = await TestUtility.DeserializeJsonAsync("Episodes\\episode_minimal_images.json"); + + episode.ShouldNotBeNull(); + + episode!.Season.ShouldBe(1U); + episode!.Number.ShouldBe(1U); + episode!.Title.ShouldBe("Winter Is Coming"); + + episode!.IDs.ShouldNotBeNull(); + episode!.IDs!.Trakt.ShouldBe(73640U); + episode!.IDs!.TVDB.ShouldBe(3254641U); + episode!.IDs!.IMDB.ShouldBe("tt1480055"); + episode!.IDs!.TMDB.ShouldBe(63056U); + episode!.IDs!.HasAnyID.ShouldBe(true); + episode!.IDs!.BestID.ShouldBe("73640"); + + episode!.Images.ShouldNotBeNull(); + + episode!.Images!.Screenshot.ShouldNotBeNull(); + episode!.Images!.Screenshot!.Count.ShouldBe(1); + episode!.Images!.Screenshot!.ShouldBe([ "walter-r2.trakt.tv/images/episodes/000/073/640/screenshots/medium/66c1ba1793.jpg.webp" ]); + + episode!.ToString().ShouldBe("S01E01: Winter Is Coming"); + } + + [Fact] + public async Task TestTraktEpisodeFromJsonFull() + { + TraktEpisode? episode = await TestUtility.DeserializeJsonAsync("Episodes\\episode_full.json"); + + episode.ShouldNotBeNull(); + + episode!.Season.ShouldBe(1U); + episode!.Number.ShouldBe(1U); + episode!.NumberAbsolute.ShouldBe(1U); + episode!.Title.ShouldBe("Winter Is Coming"); + + episode!.IDs.ShouldNotBeNull(); + episode!.IDs!.Trakt.ShouldBe(73640U); + episode!.IDs!.TVDB.ShouldBe(3254641U); + episode!.IDs!.IMDB.ShouldBe("tt1480055"); + episode!.IDs!.TMDB.ShouldBe(63056U); + episode!.IDs!.HasAnyID.ShouldBe(true); + episode!.IDs!.BestID.ShouldBe("73640"); + + episode!.ToString().ShouldBe("S01E01: Winter Is Coming"); + + episode!.Overview.ShouldBe("Jon Arryn, the Hand of the King, is dead. King Robert Baratheon plans to ask his oldest friend," + + " Eddard Stark, to take Jon's place. Across the sea, Viserys Targaryen plans to wed his sister to a nomadic warlord in " + + "exchange for an army."); + + episode!.Rating.ShouldBe(8.08208f); + episode!.Votes.ShouldBe(14619U); + episode!.CommentCount.ShouldBe(38U); + episode!.FirstAired.ShouldBe(TestUtility.ParseUTCDateTime("2011-04-18T01:00:00.000Z")); + episode!.UpdatedAt.ShouldBe(TestUtility.ParseUTCDateTime("2024-03-22T18:44:49.000Z")); + episode!.Runtime.ShouldBe(62U); + episode!.EpisodeType.ShouldBe(TraktEpisodeType.SeriesPremiere); + + episode!.AvailableTranslations.ShouldNotBeNull(); + episode!.AvailableTranslations!.Count.ShouldBe(30); + episode!.AvailableTranslations!.ShouldBe([ + "ar", "bg", "bs", "ca", "cs", "da", "de", "el", "en", "es", "fa", "fi", "fr", "he", "hu", + "it", "ja", "ko", "nl", "no", "pl", "pt", "ro", "ru", "sk", "sl", "sv", "tr", "uk", "zh" + ], Case.Sensitive); + + episode.Translations.ShouldBeNull(); + } + + [Fact] + public async Task TestTraktEpisodeFromJsonFullWithImages() + { + TraktEpisode? episode = await TestUtility.DeserializeJsonAsync("Episodes\\episode_full_images.json"); episode.ShouldNotBeNull(); @@ -89,6 +161,12 @@ public async Task TestTraktEpisodeFromJson() "it", "ja", "ko", "nl", "no", "pl", "pt", "ro", "ru", "sk", "sl", "sv", "tr", "uk", "zh" ], Case.Sensitive); + episode!.Images.ShouldNotBeNull(); + + episode!.Images!.Screenshot.ShouldNotBeNull(); + episode!.Images!.Screenshot!.Count.ShouldBe(1); + episode!.Images!.Screenshot!.ShouldBe([ "walter-r2.trakt.tv/images/episodes/000/073/640/screenshots/medium/66c1ba1793.jpg.webp" ]); + episode.Translations.ShouldBeNull(); } diff --git a/src/tests/libs/Trakt.NET.Json.Tests/Movies/TraktMovieImagesTests.cs b/src/tests/libs/Trakt.NET.Json.Tests/Movies/TraktMovieImagesTests.cs new file mode 100644 index 000000000..806190c33 --- /dev/null +++ b/src/tests/libs/Trakt.NET.Json.Tests/Movies/TraktMovieImagesTests.cs @@ -0,0 +1,50 @@ +namespace TraktNET.Json.Movies +{ + public sealed class TraktMovieImagesTests + { + [Fact] + public void TestTraktMovieImagesConstructor() + { + var movieImages = new TraktMovieImages(); + + movieImages.Fanart.ShouldBeNull(); + movieImages.Poster.ShouldBeNull(); + movieImages.Logo.ShouldBeNull(); + movieImages.Clearart.ShouldBeNull(); + movieImages.Banner.ShouldBeNull(); + movieImages.Thumb.ShouldBeNull(); + } + + [Fact] + public async Task TestTraktMovieImagesFromJson() + { + TraktMovieImages? movieImages = await TestUtility.DeserializeJsonAsync("Movies\\movieimages.json"); + + movieImages.ShouldNotBeNull(); + + movieImages!.Fanart.ShouldNotBeNull(); + movieImages!.Fanart!.Count.ShouldBe(1); + movieImages!.Fanart!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/fanarts/medium/2ea7854adf.jpg.webp" ]); + + movieImages!.Poster.ShouldNotBeNull(); + movieImages!.Poster!.Count.ShouldBe(1); + movieImages!.Poster!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/posters/thumb/61ceb0624b.jpg.webp" ]); + + movieImages!.Logo.ShouldNotBeNull(); + movieImages!.Logo!.Count.ShouldBe(1); + movieImages!.Logo!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/logos/medium/9021d3352d.png.webp" ]); + + movieImages!.Clearart.ShouldNotBeNull(); + movieImages!.Clearart!.Count.ShouldBe(1); + movieImages!.Clearart!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/cleararts/medium/719bb7c638.png.webp" ]); + + movieImages!.Banner.ShouldNotBeNull(); + movieImages!.Banner!.Count.ShouldBe(1); + movieImages!.Banner!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/banners/medium/aadecf57bf.jpg.webp" ]); + + movieImages!.Thumb.ShouldNotBeNull(); + movieImages!.Thumb!.Count.ShouldBe(1); + movieImages!.Thumb!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/thumbs/medium/6d944d9545.jpg.webp" ]); + } + } +} diff --git a/src/tests/libs/Trakt.NET.Json.Tests/Movies/TraktMovieTests.cs b/src/tests/libs/Trakt.NET.Json.Tests/Movies/TraktMovieTests.cs index 9dae8bb65..358650ed7 100644 --- a/src/tests/libs/Trakt.NET.Json.Tests/Movies/TraktMovieTests.cs +++ b/src/tests/libs/Trakt.NET.Json.Tests/Movies/TraktMovieTests.cs @@ -52,9 +52,55 @@ public async Task TestTraktMovieFromJsonMinimal() } [Fact] - public async Task TestTraktMovieFromJson() + public async Task TestTraktMovieFromJsonMinimalWithImages() { - TraktMovie? movie = await TestUtility.DeserializeJsonAsync("Movies\\movie.json"); + TraktMovieMinimal? movie = await TestUtility.DeserializeJsonAsync("Movies\\movie_minimal_images.json"); + + movie.ShouldNotBeNull(); + + movie!.Title.ShouldBe("Guardians of the Galaxy Volume 3"); + movie!.Year.ShouldBe(2023U); + + movie!.IDs!.Trakt.ShouldBe(293990U); + movie!.IDs!.Slug.ShouldBe("guardians-of-the-galaxy-volume-3-2023"); + movie!.IDs!.IMDB.ShouldBe("tt6791350"); + movie!.IDs!.TMDB.ShouldBe(447365U); + movie!.IDs!.HasAnyID.ShouldBe(true); + movie!.IDs!.BestID.ShouldBe("guardians-of-the-galaxy-volume-3-2023"); + + movie!.Images.ShouldNotBeNull(); + + movie!.Images!.Fanart.ShouldNotBeNull(); + movie!.Images!.Fanart!.Count.ShouldBe(1); + movie!.Images!.Fanart!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/fanarts/medium/2ea7854adf.jpg.webp" ]); + + movie!.Images!.Poster.ShouldNotBeNull(); + movie!.Images!.Poster!.Count.ShouldBe(1); + movie!.Images!.Poster!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/posters/thumb/61ceb0624b.jpg.webp" ]); + + movie!.Images!.Logo.ShouldNotBeNull(); + movie!.Images!.Logo!.Count.ShouldBe(1); + movie!.Images!.Logo!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/logos/medium/9021d3352d.png.webp" ]); + + movie!.Images!.Clearart.ShouldNotBeNull(); + movie!.Images!.Clearart!.Count.ShouldBe(1); + movie!.Images!.Clearart!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/cleararts/medium/719bb7c638.png.webp" ]); + + movie!.Images!.Banner.ShouldNotBeNull(); + movie!.Images!.Banner!.Count.ShouldBe(1); + movie!.Images!.Banner!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/banners/medium/aadecf57bf.jpg.webp" ]); + + movie!.Images!.Thumb.ShouldNotBeNull(); + movie!.Images!.Thumb!.Count.ShouldBe(1); + movie!.Images!.Thumb!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/thumbs/medium/6d944d9545.jpg.webp" ]); + + movie!.ToString().ShouldBe("Guardians of the Galaxy Volume 3 (2023)"); + } + + [Fact] + public async Task TestTraktMovieFromJsonFull() + { + TraktMovie? movie = await TestUtility.DeserializeJsonAsync("Movies\\movie_full.json"); movie.ShouldNotBeNull(); @@ -111,5 +157,92 @@ public async Task TestTraktMovieFromJson() movie!.Certification.ShouldBe("PG-13"); } + + [Fact] + public async Task TestTraktMovieFromJsonFullWithImages() + { + TraktMovie? movie = await TestUtility.DeserializeJsonAsync("Movies\\movie_full_images.json"); + + movie.ShouldNotBeNull(); + + movie!.Title.ShouldBe("Guardians of the Galaxy Volume 3"); + movie!.Year.ShouldBe(2023U); + + movie!.IDs!.Trakt.ShouldBe(293990U); + movie!.IDs!.Slug.ShouldBe("guardians-of-the-galaxy-volume-3-2023"); + movie!.IDs!.IMDB.ShouldBe("tt6791350"); + movie!.IDs!.TMDB.ShouldBe(447365U); + movie!.IDs!.HasAnyID.ShouldBe(true); + movie!.IDs!.BestID.ShouldBe("guardians-of-the-galaxy-volume-3-2023"); + + movie!.ToString().ShouldBe("Guardians of the Galaxy Volume 3 (2023)"); + + movie!.Tagline.ShouldBe("Once more with feeling."); + + movie!.Overview.ShouldBe("Peter Quill, still reeling from the loss of Gamora, must rally his team around him to defend the " + + "universe along with protecting one of their own. A mission that, if not completed successfully, could quite possibly " + + "lead to the end of the Guardians as we know them."); + +#if NET7_0_OR_GREATER + movie!.Released.ShouldBe(TestUtility.ParseDate("2023-05-05")); +#else + movie!.Released.ShouldBe(TestUtility.ParseUTCDateTime("2023-05-05T00:00:00.000Z")); +#endif + movie!.Runtime.ShouldBe(150U); + movie!.Country.ShouldBe("us"); + movie!.Trailer.ShouldBe("https://youtube.com/watch?v=AAE5VZktooM"); + movie!.Homepage.ShouldBe("http://www.marvel.com/movies/guardians-of-the-galaxy-volume-3"); + movie!.Status.ShouldBe(TraktMovieStatus.Released); + movie!.Rating.ShouldBe(7.976602658788774f); + movie!.Votes.ShouldBe(16925U); + movie!.CommentCount.ShouldBe(170U); + movie!.UpdatedAt.ShouldBe(TestUtility.ParseUTCDateTime("2024-03-23T08:06:45.000Z")); + movie!.Language.ShouldBe("en"); + movie!.Languages.ShouldNotBeNull(); + movie!.Languages!.Count.ShouldBe(1); + movie!.Languages!.ShouldBe(["en"], Case.Sensitive); + + movie!.AvailableTranslations.ShouldNotBeNull(); + movie!.AvailableTranslations!.Count.ShouldBe(39); + movie!.AvailableTranslations!.ShouldBe([ + "ar", "bg", "ca", "cs", "da", "de", "el", "en", "eo", "es", "fa", "fi", "fr", "he", "hr", + "hu", "id", "it", "ja", "ka", "ko", "lt", "lv", "my", "nl", "no", "pl", "pt", "ro", "ru", + "sk", "sl", "sr", "sv", "th", "tr", "uk", "vi", "zh" + ], Case.Sensitive); + + movie!.Genres.ShouldNotBeNull(); + movie!.Genres!.Count.ShouldBe(4); + movie!.Genres!.ShouldBe([ + "science-fiction", "superhero", "action", "adventure" + ], Case.Sensitive); + + movie!.Certification.ShouldBe("PG-13"); + + movie!.Images.ShouldNotBeNull(); + + movie!.Images!.Fanart.ShouldNotBeNull(); + movie!.Images!.Fanart!.Count.ShouldBe(1); + movie!.Images!.Fanart!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/fanarts/medium/2ea7854adf.jpg.webp" ]); + + movie!.Images!.Poster.ShouldNotBeNull(); + movie!.Images!.Poster!.Count.ShouldBe(1); + movie!.Images!.Poster!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/posters/thumb/61ceb0624b.jpg.webp" ]); + + movie!.Images!.Logo.ShouldNotBeNull(); + movie!.Images!.Logo!.Count.ShouldBe(1); + movie!.Images!.Logo!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/logos/medium/9021d3352d.png.webp" ]); + + movie!.Images!.Clearart.ShouldNotBeNull(); + movie!.Images!.Clearart!.Count.ShouldBe(1); + movie!.Images!.Clearart!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/cleararts/medium/719bb7c638.png.webp" ]); + + movie!.Images!.Banner.ShouldNotBeNull(); + movie!.Images!.Banner!.Count.ShouldBe(1); + movie!.Images!.Banner!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/banners/medium/aadecf57bf.jpg.webp" ]); + + movie!.Images!.Thumb.ShouldNotBeNull(); + movie!.Images!.Thumb!.Count.ShouldBe(1); + movie!.Images!.Thumb!.ShouldBe([ "walter-r2.trakt.tv/images/movies/000/293/990/thumbs/medium/6d944d9545.jpg.webp" ]); + } } } diff --git a/src/tests/libs/Trakt.NET.Json.Tests/People/TraktPersonImagesTests.cs b/src/tests/libs/Trakt.NET.Json.Tests/People/TraktPersonImagesTests.cs new file mode 100644 index 000000000..8e6f8a10c --- /dev/null +++ b/src/tests/libs/Trakt.NET.Json.Tests/People/TraktPersonImagesTests.cs @@ -0,0 +1,30 @@ +namespace TraktNET.Json.Persons +{ + public sealed class TraktPersonImagesTests + { + [Fact] + public void TestTraktPersonImagesConstructor() + { + var personImages = new TraktPersonImages(); + + personImages.Headshot.ShouldBeNull(); + personImages.Fanart.ShouldBeNull(); + } + + [Fact] + public async Task TestTraktPersonImagesFromJson() + { + TraktPersonImages? personImages = await TestUtility.DeserializeJsonAsync("People\\personimages.json"); + + personImages.ShouldNotBeNull(); + + personImages!.Headshot.ShouldNotBeNull(); + personImages!.Headshot!.Count.ShouldBe(1); + personImages!.Headshot!.ShouldBe([ "walter-r2.trakt.tv/images/people/000/297/737/headshots/thumb/ef96a1e565.jpg.webp" ]); + + personImages!.Fanart.ShouldNotBeNull(); + personImages!.Fanart!.Count.ShouldBe(1); + personImages!.Fanart!.ShouldBe([ "walter-r2.trakt.tv/images/people/000/297/737/fanarts/medium/ec609f5bcc.jpg.webp" ]); + } + } +} diff --git a/src/tests/libs/Trakt.NET.Json.Tests/People/TraktPersonTests.cs b/src/tests/libs/Trakt.NET.Json.Tests/People/TraktPersonTests.cs index ae35b38e2..45caecdfc 100644 --- a/src/tests/libs/Trakt.NET.Json.Tests/People/TraktPersonTests.cs +++ b/src/tests/libs/Trakt.NET.Json.Tests/People/TraktPersonTests.cs @@ -39,9 +39,37 @@ public async Task TestTraktPersonFromJsonMinimal() } [Fact] - public async Task TestTraktPersonFromJson() + public async Task TestTraktPersonFromJsonMinimalWithImages() { - TraktPerson? person = await TestUtility.DeserializeJsonAsync("People\\person.json"); + TraktPersonMinimal? person = await TestUtility.DeserializeJsonAsync("People\\person_minimal_images.json"); + + person.ShouldNotBeNull(); + + person!.Name.ShouldBe("Bryan Cranston"); + + person!.IDs.ShouldNotBeNull(); + person!.IDs!.Trakt.ShouldBe(297737U); + person!.IDs!.Slug.ShouldBe("bryan-cranston"); + person!.IDs!.IMDB.ShouldBe("nm0186505"); + person!.IDs!.TMDB.ShouldBe(17419U); + person!.IDs!.HasAnyID.ShouldBe(true); + person!.IDs!.BestID.ShouldBe("bryan-cranston"); + + person!.Images.ShouldNotBeNull(); + + person!.Images!.Headshot.ShouldNotBeNull(); + person!.Images!.Headshot!.Count.ShouldBe(1); + person!.Images!.Headshot!.ShouldBe([ "walter-r2.trakt.tv/images/people/000/297/737/headshots/thumb/ef96a1e565.jpg.webp" ]); + + person!.Images!.Fanart.ShouldNotBeNull(); + person!.Images!.Fanart!.Count.ShouldBe(1); + person!.Images!.Fanart!.ShouldBe([ "walter-r2.trakt.tv/images/people/000/297/737/fanarts/medium/ec609f5bcc.jpg.webp" ]); + } + + [Fact] + public async Task TestTraktPersonFromJsonFull() + { + TraktPerson? person = await TestUtility.DeserializeJsonAsync("People\\person_full.json"); person.ShouldNotBeNull(); @@ -78,5 +106,56 @@ public async Task TestTraktPersonFromJson() person!.Gender.ShouldBe(TraktGender.Male); person!.UpdatedAt.ShouldBe(TestUtility.ParseUTCDateTime("2024-03-22T08:01:24.000Z")); } + + [Fact] + public async Task TestTraktPersonFromJsonFullWithImages() + { + TraktPerson? person = await TestUtility.DeserializeJsonAsync("People\\person_full_images.json"); + + person.ShouldNotBeNull(); + + person!.Name.ShouldBe("Bryan Cranston"); + + person!.IDs.ShouldNotBeNull(); + person!.IDs!.Trakt.ShouldBe(297737U); + person!.IDs!.Slug.ShouldBe("bryan-cranston"); + person!.IDs!.IMDB.ShouldBe("nm0186505"); + person!.IDs!.TMDB.ShouldBe(17419U); + person!.IDs!.HasAnyID.ShouldBe(true); + person!.IDs!.BestID.ShouldBe("bryan-cranston"); + + person!.SocialIDs.ShouldNotBeNull(); + person!.SocialIDs!.Twitter.ShouldBe("BryanCranston"); + person!.SocialIDs!.Facebook.ShouldBe("thebryancranston"); + person!.SocialIDs!.Instagram.ShouldBe("bryancranston"); + person!.SocialIDs!.Wikipedia.ShouldBeNull(); + + person!.Biography.ShouldBe("Bryan Lee Cranston (born March 7, 1956) is an American actor, director, and producer who " + + "is mainly known for portraying Walter White in the AMC crime drama series Breaking Bad (2008–2013) and Hal in " + + "the Fox sitcom Malcolm in the Middle (2000–2006)."); + +#if NET7_0_OR_GREATER + person!.Birthday.ShouldBe(TestUtility.ParseDate("1956-03-07")); +#else + + person!.Birthday.ShouldBe(TestUtility.ParseUTCDateTime("1956-03-07T00:00:00.000Z")); +#endif + person!.Death.ShouldBeNull(); + person!.Birthplace.ShouldBe("Hollywood, Los Angeles, California, USA"); + person!.Homepage.ShouldBeNull(); + person!.KnownForDepartment.ShouldBe(TraktKnownForDepartment.Acting); + person!.Gender.ShouldBe(TraktGender.Male); + person!.UpdatedAt.ShouldBe(TestUtility.ParseUTCDateTime("2024-03-22T08:01:24.000Z")); + + person!.Images.ShouldNotBeNull(); + + person!.Images!.Headshot.ShouldNotBeNull(); + person!.Images!.Headshot!.Count.ShouldBe(1); + person!.Images!.Headshot!.ShouldBe([ "walter-r2.trakt.tv/images/people/000/297/737/headshots/thumb/ef96a1e565.jpg.webp" ]); + + person!.Images!.Fanart.ShouldNotBeNull(); + person!.Images!.Fanart!.Count.ShouldBe(1); + person!.Images!.Fanart!.ShouldBe([ "walter-r2.trakt.tv/images/people/000/297/737/fanarts/medium/ec609f5bcc.jpg.webp" ]); + } } } diff --git a/src/tests/libs/Trakt.NET.Json.Tests/Seasons/TraktSeasonImagesTests.cs b/src/tests/libs/Trakt.NET.Json.Tests/Seasons/TraktSeasonImagesTests.cs new file mode 100644 index 000000000..3c020e4aa --- /dev/null +++ b/src/tests/libs/Trakt.NET.Json.Tests/Seasons/TraktSeasonImagesTests.cs @@ -0,0 +1,30 @@ +namespace TraktNET.Json.Seasons +{ + public sealed class TraktSeasonImagesTests + { + [Fact] + public void TestTraktSeasonImagesConstructor() + { + var seasonImages = new TraktSeasonImages(); + + seasonImages.Poster.ShouldBeNull(); + seasonImages.Thumb.ShouldBeNull(); + } + + [Fact] + public async Task TestTraktSeasonImagesFromJson() + { + TraktSeasonImages? seasonImages = await TestUtility.DeserializeJsonAsync("Seasons\\seasonimages.json"); + + seasonImages.ShouldNotBeNull(); + + seasonImages!.Poster.ShouldNotBeNull(); + seasonImages!.Poster!.Count.ShouldBe(1); + seasonImages!.Poster!.ShouldBe([ "walter-r2.trakt.tv/images/seasons/000/003/963/posters/thumb/15e611179e.jpg.webp" ]); + + seasonImages!.Thumb.ShouldNotBeNull(); + seasonImages!.Thumb!.Count.ShouldBe(1); + seasonImages!.Thumb!.ShouldBe([ "walter-r2.trakt.tv/images/seasons/000/003/963/thumbs/medium/6c996deed7.jpg.webp" ]); + } + } +} diff --git a/src/tests/libs/Trakt.NET.Json.Tests/Seasons/TraktSeasonTests.cs b/src/tests/libs/Trakt.NET.Json.Tests/Seasons/TraktSeasonTests.cs index 1c36dd175..77ebcc15f 100644 --- a/src/tests/libs/Trakt.NET.Json.Tests/Seasons/TraktSeasonTests.cs +++ b/src/tests/libs/Trakt.NET.Json.Tests/Seasons/TraktSeasonTests.cs @@ -41,9 +41,66 @@ public async Task TestTraktSeasonFromJsonMinimal() } [Fact] - public async Task TestTraktSeasonFromJson() + public async Task TestTraktSeasonFromJsonMinimalWithImages() { - TraktSeason? season = await TestUtility.DeserializeJsonAsync("Seasons\\season.json"); + TraktSeasonMinimal? season = await TestUtility.DeserializeJsonAsync("Seasons\\season_minimal_images.json"); + + season.ShouldNotBeNull(); + + season!.Number.ShouldBe(1U); + + season!.IDs.ShouldNotBeNull(); + season!.IDs!.Trakt.ShouldBe(3963U); + season!.IDs!.TVDB.ShouldBe(364731U); + season!.IDs!.TMDB.ShouldBe(3624U); + season!.IDs!.HasAnyID.ShouldBe(true); + season!.IDs!.BestID.ShouldBe("3963"); + + season!.Images.ShouldNotBeNull(); + + season!.Images!.Poster.ShouldNotBeNull(); + season!.Images!.Poster!.Count.ShouldBe(1); + season!.Images!.Poster!.ShouldBe([ "walter-r2.trakt.tv/images/seasons/000/003/963/posters/thumb/15e611179e.jpg.webp" ]); + + season!.Images!.Thumb.ShouldNotBeNull(); + season!.Images!.Thumb!.Count.ShouldBe(1); + season!.Images!.Thumb!.ShouldBe([ "walter-r2.trakt.tv/images/seasons/000/003/963/thumbs/medium/6c996deed7.jpg.webp" ]); + } + + [Fact] + public async Task TestTraktSeasonFromJsonFull() + { + TraktSeason? season = await TestUtility.DeserializeJsonAsync("Seasons\\season_full.json"); + + season.ShouldNotBeNull(); + + season!.Number.ShouldBe(1U); + + season!.IDs.ShouldNotBeNull(); + season!.IDs!.Trakt.ShouldBe(3963U); + season!.IDs!.TVDB.ShouldBe(364731U); + season!.IDs!.TMDB.ShouldBe(3624U); + season!.IDs!.HasAnyID.ShouldBe(true); + season!.IDs!.BestID.ShouldBe("3963"); + + season!.Rating.ShouldBe(8.96076f); + season!.Votes.ShouldBe(4970U); + season!.EpisodeCount.ShouldBe(10U); + season!.AiredEpisodes.ShouldBe(10U); + season!.Title.ShouldBe("Season 1"); + season!.Overview.ShouldBe("Trouble is brewing in the Seven Kingdoms of Westeros."); + season!.FirstAired.ShouldBe(TestUtility.ParseUTCDateTime("2011-04-18T01:00:00.000Z")); + season!.UpdatedAt.ShouldBe(TestUtility.ParseUTCDateTime("2024-03-23T06:24:59.000Z")); + season!.Network.ShouldBe("HBO"); + season!.Episodes.ShouldBeNull(); + + season!.ToString().ShouldBe("S01: Season 1"); + } + + [Fact] + public async Task TestTraktSeasonFromJsonFullWithImages() + { + TraktSeason? season = await TestUtility.DeserializeJsonAsync("Seasons\\season_full_images.json"); season.ShouldNotBeNull(); @@ -67,13 +124,23 @@ public async Task TestTraktSeasonFromJson() season!.Network.ShouldBe("HBO"); season!.Episodes.ShouldBeNull(); + season!.Images.ShouldNotBeNull(); + + season!.Images!.Poster.ShouldNotBeNull(); + season!.Images!.Poster!.Count.ShouldBe(1); + season!.Images!.Poster!.ShouldBe([ "walter-r2.trakt.tv/images/seasons/000/003/963/posters/thumb/15e611179e.jpg.webp" ]); + + season!.Images!.Thumb.ShouldNotBeNull(); + season!.Images!.Thumb!.Count.ShouldBe(1); + season!.Images!.Thumb!.ShouldBe([ "walter-r2.trakt.tv/images/seasons/000/003/963/thumbs/medium/6c996deed7.jpg.webp" ]); + season!.ToString().ShouldBe("S01: Season 1"); } [Fact] - public async Task TestTraktSeasonFromJsonWithEpisodes() + public async Task TestTraktSeasonFromJsonFullWithEpisodes() { - TraktSeason? season = await TestUtility.DeserializeJsonAsync("Seasons\\season_with_episodes.json"); + TraktSeason? season = await TestUtility.DeserializeJsonAsync("Seasons\\season_full_episodes.json"); season.ShouldNotBeNull(); @@ -202,5 +269,148 @@ public async Task TestTraktSeasonFromJsonWithEpisodes() episodes[9].IDs!.IMDB.ShouldBe("tt1851397"); episodes[9].IDs!.TMDB.ShouldBe(63065U); } + + [Fact] + public async Task TestTraktSeasonFromJsonFullWithEpisodesAndImages() + { + TraktSeason? season = await TestUtility.DeserializeJsonAsync("Seasons\\season_full_episodes_images.json"); + + season.ShouldNotBeNull(); + + season!.Number.ShouldBe(1U); + + season!.IDs.ShouldNotBeNull(); + season!.IDs!.Trakt.ShouldBe(3963U); + season!.IDs!.TVDB.ShouldBe(364731U); + season!.IDs!.TMDB.ShouldBe(3624U); + season!.IDs!.HasAnyID.ShouldBe(true); + season!.IDs!.BestID.ShouldBe("3963"); + + season!.Rating.ShouldBe(8.96076f); + season!.Votes.ShouldBe(4970U); + season!.EpisodeCount.ShouldBe(10U); + season!.AiredEpisodes.ShouldBe(10U); + season!.Title.ShouldBe("Season 1"); + season!.Overview.ShouldBe("Trouble is brewing in the Seven Kingdoms of Westeros."); + season!.FirstAired.ShouldBe(TestUtility.ParseUTCDateTime("2011-04-18T01:00:00.000Z")); + season!.UpdatedAt.ShouldBe(TestUtility.ParseUTCDateTime("2024-03-23T06:24:59.000Z")); + season!.Network.ShouldBe("HBO"); + season!.Episodes.ShouldNotBeNull(); + season!.Episodes!.Count.ShouldBe(10); + + season!.Images.ShouldNotBeNull(); + + season!.Images!.Poster.ShouldNotBeNull(); + season!.Images!.Poster!.Count.ShouldBe(1); + season!.Images!.Poster!.ShouldBe([ "walter-r2.trakt.tv/images/seasons/000/003/963/posters/thumb/15e611179e.jpg.webp" ]); + + season!.Images!.Thumb.ShouldNotBeNull(); + season!.Images!.Thumb!.Count.ShouldBe(1); + season!.Images!.Thumb!.ShouldBe([ "walter-r2.trakt.tv/images/seasons/000/003/963/thumbs/medium/6c996deed7.jpg.webp" ]); + + season!.ToString().ShouldBe("S01: Season 1"); + + List episodes = season!.Episodes!; + + episodes[0].ShouldNotBeNull(); + episodes[0].Season.ShouldBe(1U); + episodes[0].Number.ShouldBe(1U); + episodes[0].Title.ShouldBe("Winter Is Coming"); + episodes[0].IDs.ShouldNotBeNull(); + episodes[0].IDs!.Trakt.ShouldBe(73640U); + episodes[0].IDs!.TVDB.ShouldBe(3254641U); + episodes[0].IDs!.IMDB.ShouldBe("tt1480055"); + episodes[0].IDs!.TMDB.ShouldBe(63056U); + + episodes[1].ShouldNotBeNull(); + episodes[1].Season.ShouldBe(1U); + episodes[1].Number.ShouldBe(2U); + episodes[1].Title.ShouldBe("The Kingsroad"); + episodes[1].IDs.ShouldNotBeNull(); + episodes[1].IDs!.Trakt.ShouldBe(73641U); + episodes[1].IDs!.TVDB.ShouldBe(3436411U); + episodes[1].IDs!.IMDB.ShouldBe("tt1668746"); + episodes[1].IDs!.TMDB.ShouldBe(63057U); + + episodes[2].ShouldNotBeNull(); + episodes[2].Season.ShouldBe(1U); + episodes[2].Number.ShouldBe(3U); + episodes[2].Title.ShouldBe("Lord Snow"); + episodes[2].IDs.ShouldNotBeNull(); + episodes[2].IDs!.Trakt.ShouldBe(73642U); + episodes[2].IDs!.TVDB.ShouldBe(3436421U); + episodes[2].IDs!.IMDB.ShouldBe("tt1829962"); + episodes[2].IDs!.TMDB.ShouldBe(63058U); + + episodes[3].ShouldNotBeNull(); + episodes[3].Season.ShouldBe(1U); + episodes[3].Number.ShouldBe(4U); + episodes[3].Title.ShouldBe("Cripples, Bastards, and Broken Things"); + episodes[3].IDs.ShouldNotBeNull(); + episodes[3].IDs!.Trakt.ShouldBe(73643U); + episodes[3].IDs!.TVDB.ShouldBe(3436431U); + episodes[3].IDs!.IMDB.ShouldBe("tt1829963"); + episodes[3].IDs!.TMDB.ShouldBe(63059U); + + episodes[4].ShouldNotBeNull(); + episodes[4].Season.ShouldBe(1U); + episodes[4].Number.ShouldBe(5U); + episodes[4].Title.ShouldBe("The Wolf and the Lion"); + episodes[4].IDs.ShouldNotBeNull(); + episodes[4].IDs!.Trakt.ShouldBe(73644U); + episodes[4].IDs!.TVDB.ShouldBe(3436441U); + episodes[4].IDs!.IMDB.ShouldBe("tt1829964"); + episodes[4].IDs!.TMDB.ShouldBe(63060U); + + episodes[5].ShouldNotBeNull(); + episodes[5].Season.ShouldBe(1U); + episodes[5].Number.ShouldBe(6U); + episodes[5].Title.ShouldBe("A Golden Crown"); + episodes[5].IDs.ShouldNotBeNull(); + episodes[5].IDs!.Trakt.ShouldBe(73645U); + episodes[5].IDs!.TVDB.ShouldBe(3436451U); + episodes[5].IDs!.IMDB.ShouldBe("tt1837862"); + episodes[5].IDs!.TMDB.ShouldBe(63061U); + + episodes[6].ShouldNotBeNull(); + episodes[6].Season.ShouldBe(1U); + episodes[6].Number.ShouldBe(7U); + episodes[6].Title.ShouldBe("You Win or You Die"); + episodes[6].IDs.ShouldNotBeNull(); + episodes[6].IDs!.Trakt.ShouldBe(73646U); + episodes[6].IDs!.TVDB.ShouldBe(3436461U); + episodes[6].IDs!.IMDB.ShouldBe("tt1837863"); + episodes[6].IDs!.TMDB.ShouldBe(63062U); + + episodes[7].ShouldNotBeNull(); + episodes[7].Season.ShouldBe(1U); + episodes[7].Number.ShouldBe(8U); + episodes[7].Title.ShouldBe("The Pointy End"); + episodes[7].IDs.ShouldNotBeNull(); + episodes[7].IDs!.Trakt.ShouldBe(73647U); + episodes[7].IDs!.TVDB.ShouldBe(3360391U); + episodes[7].IDs!.IMDB.ShouldBe("tt1837864"); + episodes[7].IDs!.TMDB.ShouldBe(63063U); + + episodes[8].ShouldNotBeNull(); + episodes[8].Season.ShouldBe(1U); + episodes[8].Number.ShouldBe(9U); + episodes[8].Title.ShouldBe("Baelor"); + episodes[8].IDs.ShouldNotBeNull(); + episodes[8].IDs!.Trakt.ShouldBe(73648U); + episodes[8].IDs!.TVDB.ShouldBe(4063481U); + episodes[8].IDs!.IMDB.ShouldBe("tt1851398"); + episodes[8].IDs!.TMDB.ShouldBe(63064U); + + episodes[9].ShouldNotBeNull(); + episodes[9].Season.ShouldBe(1U); + episodes[9].Number.ShouldBe(10U); + episodes[9].Title.ShouldBe("Fire and Blood"); + episodes[9].IDs.ShouldNotBeNull(); + episodes[9].IDs!.Trakt.ShouldBe(73649U); + episodes[9].IDs!.TVDB.ShouldBe(4063491U); + episodes[9].IDs!.IMDB.ShouldBe("tt1851397"); + episodes[9].IDs!.TMDB.ShouldBe(63065U); + } } } diff --git a/src/tests/libs/Trakt.NET.Json.Tests/Shows/TraktShowImagesTests.cs b/src/tests/libs/Trakt.NET.Json.Tests/Shows/TraktShowImagesTests.cs new file mode 100644 index 000000000..3177a9de2 --- /dev/null +++ b/src/tests/libs/Trakt.NET.Json.Tests/Shows/TraktShowImagesTests.cs @@ -0,0 +1,50 @@ +namespace TraktNET.Json.Shows +{ + public sealed class TraktShowImagesTests + { + [Fact] + public void TestTraktShowImagesConstructor() + { + var showImages = new TraktShowImages(); + + showImages.Fanart.ShouldBeNull(); + showImages.Poster.ShouldBeNull(); + showImages.Logo.ShouldBeNull(); + showImages.Clearart.ShouldBeNull(); + showImages.Banner.ShouldBeNull(); + showImages.Thumb.ShouldBeNull(); + } + + [Fact] + public async Task TestTraktShowImagesFromJson() + { + TraktShowImages? showImages = await TestUtility.DeserializeJsonAsync("Shows\\showimages.json"); + + showImages.ShouldNotBeNull(); + + showImages!.Fanart.ShouldNotBeNull(); + showImages!.Fanart!.Count.ShouldBe(1); + showImages!.Fanart!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/fanarts/medium/76d5df8aed.jpg.webp" ]); + + showImages!.Poster.ShouldNotBeNull(); + showImages!.Poster!.Count.ShouldBe(1); + showImages!.Poster!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/posters/thumb/93df9cd612.jpg.webp" ]); + + showImages!.Logo.ShouldNotBeNull(); + showImages!.Logo!.Count.ShouldBe(1); + showImages!.Logo!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/logos/medium/13b614ad43.png.webp" ]); + + showImages!.Clearart.ShouldNotBeNull(); + showImages!.Clearart!.Count.ShouldBe(1); + showImages!.Clearart!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/cleararts/medium/5cbde9e647.png.webp" ]); + + showImages!.Banner.ShouldNotBeNull(); + showImages!.Banner!.Count.ShouldBe(1); + showImages!.Banner!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/banners/medium/9fefff703d.jpg.webp" ]); + + showImages!.Thumb.ShouldNotBeNull(); + showImages!.Thumb!.Count.ShouldBe(1); + showImages!.Thumb!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/thumbs/medium/7beccbd5a1.jpg.webp" ]); + } + } +} diff --git a/src/tests/libs/Trakt.NET.Json.Tests/Shows/TraktShowTests.cs b/src/tests/libs/Trakt.NET.Json.Tests/Shows/TraktShowTests.cs index f07c45aa8..bba23bd45 100644 --- a/src/tests/libs/Trakt.NET.Json.Tests/Shows/TraktShowTests.cs +++ b/src/tests/libs/Trakt.NET.Json.Tests/Shows/TraktShowTests.cs @@ -57,9 +57,125 @@ public async Task TestTraktShowFromJsonMinimal() } [Fact] - public async Task TestTraktShowFromJson() + public async Task TestTraktShowFromJsonMinimalWithImages() { - TraktShow? show = await TestUtility.DeserializeJsonAsync("Shows\\show.json"); + TraktShowMinimal? show = await TestUtility.DeserializeJsonAsync("Shows\\show_minimal_images.json"); + + show.ShouldNotBeNull(); + + show!.Title.ShouldBe("Game of Thrones"); + show!.Year.ShouldBe(2011U); + + show!.IDs.ShouldNotBeNull(); + show!.IDs!.Trakt.ShouldBe(1390U); + show!.IDs!.Slug.ShouldBe("game-of-thrones"); + show!.IDs!.TVDB.ShouldBe(121361U); + show!.IDs!.IMDB.ShouldBe("tt0944947"); + show!.IDs!.TMDB.ShouldBe(1399U); + show!.IDs!.HasAnyID.ShouldBe(true); + show!.IDs!.BestID.ShouldBe("game-of-thrones"); + + show!.Images.ShouldNotBeNull(); + + show!.Images!.Fanart.ShouldNotBeNull(); + show!.Images!.Fanart!.Count.ShouldBe(1); + show!.Images!.Fanart!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/fanarts/medium/76d5df8aed.jpg.webp" ]); + + show!.Images!.Poster.ShouldNotBeNull(); + show!.Images!.Poster!.Count.ShouldBe(1); + show!.Images!.Poster!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/posters/thumb/93df9cd612.jpg.webp" ]); + + show!.Images!.Logo.ShouldNotBeNull(); + show!.Images!.Logo!.Count.ShouldBe(1); + show!.Images!.Logo!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/logos/medium/13b614ad43.png.webp" ]); + + show!.Images!.Clearart.ShouldNotBeNull(); + show!.Images!.Clearart!.Count.ShouldBe(1); + show!.Images!.Clearart!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/cleararts/medium/5cbde9e647.png.webp" ]); + + show!.Images!.Banner.ShouldNotBeNull(); + show!.Images!.Banner!.Count.ShouldBe(1); + show!.Images!.Banner!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/banners/medium/9fefff703d.jpg.webp" ]); + + show!.Images!.Thumb.ShouldNotBeNull(); + show!.Images!.Thumb!.Count.ShouldBe(1); + show!.Images!.Thumb!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/thumbs/medium/7beccbd5a1.jpg.webp" ]); + + show!.ToString().ShouldBe("Game of Thrones (2011)"); + } + + [Fact] + public async Task TestTraktShowFromJsonFull() + { + TraktShow? show = await TestUtility.DeserializeJsonAsync("Shows\\show_full.json"); + + show.ShouldNotBeNull(); + + show!.Title.ShouldBe("Game of Thrones"); + show!.Year.ShouldBe(2011U); + + show!.IDs.ShouldNotBeNull(); + show!.IDs!.Trakt.ShouldBe(1390U); + show!.IDs!.Slug.ShouldBe("game-of-thrones"); + show!.IDs!.TVDB.ShouldBe(121361U); + show!.IDs!.IMDB.ShouldBe("tt0944947"); + show!.IDs!.TMDB.ShouldBe(1399U); + show!.IDs!.HasAnyID.ShouldBe(true); + show!.IDs!.BestID.ShouldBe("game-of-thrones"); + + show!.ToString().ShouldBe("Game of Thrones (2011)"); + + show!.Tagline.ShouldBe("Winter is coming."); + show!.Overview.ShouldBe("Seven noble families fight for control of the mythical land of Westeros."); + show!.FirstAired.ShouldBe(TestUtility.ParseUTCDateTime("2011-04-18T01:00:00.000Z")); + show!.UpdatedAt.ShouldBe(TestUtility.ParseUTCDateTime("2024-03-23T06:26:48.000Z")); + + show!.Airs.ShouldNotBeNull(); + show!.Airs!.Day.ShouldBe(TraktDayOfWeek.Sunday); +#if NET7_0_OR_GREATER + show!.Airs!.Time.ShouldBe(TestUtility.ParseTime("21:00")); +#else + show!.Airs!.Time.ShouldBe("21:00"); +#endif + show!.Airs!.Timezone.ShouldBe("America/New_York"); + + show!.Runtime.ShouldBe(57U); + show!.Certification.ShouldBe("TV-MA"); + show!.Network.ShouldBe("HBO"); + show!.Country.ShouldBe("us"); + show!.Trailer.ShouldBe("https://youtube.com/watch?v=KPLWWIOCOOQ"); + show!.Homepage.ShouldBe("http://www.hbo.com/game-of-thrones"); + show!.Rating.ShouldBe(8.933884809616755f); + show!.Votes.ShouldBe(129108U); + show!.CommentCount.ShouldBe(414U); + show!.Language.ShouldBe("en"); + show!.Languages.ShouldNotBeNull(); + show!.Languages!.Count.ShouldBe(1); + show!.Languages!.ShouldBe(["en"], Case.Sensitive); + + show!.AvailableTranslations.ShouldNotBeNull(); + show!.AvailableTranslations!.Count.ShouldBe(48); + show!.AvailableTranslations!.ShouldBe([ + "ar", "be", "bg", "bs", "ca", "cs", "da", "de", "el", "en", "eo", "es", "et", "fa", "fi", + "fr", "he", "hr", "hu", "id", "is", "it", "ja", "ka", "ko", "lb", "lt", "lv", "ml", "nl", + "no", "pl", "pt", "ro", "ru", "sk", "sl", "so", "sr", "sv", "ta", "th", "tr", "tw", "uk", + "uz", "vi", "zh" + ], Case.Sensitive); + + show!.Genres.ShouldNotBeNull(); + show!.Genres!.Count.ShouldBe(4); + show!.Genres!.ShouldBe([ + "fantasy", "drama", "action", "adventure" + ], Case.Sensitive); + + show!.AiredEpisodes.ShouldBe(73U); + show!.Status.ShouldBe(TraktShowStatus.Ended); + } + + [Fact] + public async Task TestTraktShowFromJsonFullWithImages() + { + TraktShow? show = await TestUtility.DeserializeJsonAsync("Shows\\show_full_images.json"); show.ShouldNotBeNull(); @@ -122,6 +238,32 @@ public async Task TestTraktShowFromJson() show!.AiredEpisodes.ShouldBe(73U); show!.Status.ShouldBe(TraktShowStatus.Ended); + + show!.Images.ShouldNotBeNull(); + + show!.Images!.Fanart.ShouldNotBeNull(); + show!.Images!.Fanart!.Count.ShouldBe(1); + show!.Images!.Fanart!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/fanarts/medium/76d5df8aed.jpg.webp" ]); + + show!.Images!.Poster.ShouldNotBeNull(); + show!.Images!.Poster!.Count.ShouldBe(1); + show!.Images!.Poster!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/posters/thumb/93df9cd612.jpg.webp" ]); + + show!.Images!.Logo.ShouldNotBeNull(); + show!.Images!.Logo!.Count.ShouldBe(1); + show!.Images!.Logo!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/logos/medium/13b614ad43.png.webp" ]); + + show!.Images!.Clearart.ShouldNotBeNull(); + show!.Images!.Clearart!.Count.ShouldBe(1); + show!.Images!.Clearart!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/cleararts/medium/5cbde9e647.png.webp" ]); + + show!.Images!.Banner.ShouldNotBeNull(); + show!.Images!.Banner!.Count.ShouldBe(1); + show!.Images!.Banner!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/banners/medium/9fefff703d.jpg.webp" ]); + + show!.Images!.Thumb.ShouldNotBeNull(); + show!.Images!.Thumb!.Count.ShouldBe(1); + show!.Images!.Thumb!.ShouldBe([ "walter-r2.trakt.tv/images/shows/000/001/390/thumbs/medium/7beccbd5a1.jpg.webp" ]); } } } diff --git a/src/tests/libs/Trakt.NET.Modules.Tests/MoviesModule/GetMovieTests.cs b/src/tests/libs/Trakt.NET.Modules.Tests/MoviesModule/GetMovieTests.cs index 0f0dc68cb..bb16c789c 100644 --- a/src/tests/libs/Trakt.NET.Modules.Tests/MoviesModule/GetMovieTests.cs +++ b/src/tests/libs/Trakt.NET.Modules.Tests/MoviesModule/GetMovieTests.cs @@ -1,4 +1,4 @@ -using System.Net; +using System.Net; namespace TraktNET.MoviesModule { @@ -10,7 +10,8 @@ public sealed class GetMovieTests [Theory] [InlineData(null, $"{GetMovieUri}/293990", "Movies\\movie_minimal.json")] [InlineData(TraktExtendedInfo.None, $"{GetMovieUri}/293990", "Movies\\movie_minimal.json")] - [InlineData(TraktExtendedInfo.Full, $"{GetMovieUri}/293990?extended=full", "Movies\\movie.json")] + [InlineData(TraktExtendedInfo.Full, $"{GetMovieUri}/293990?extended=full", "Movies\\movie_full.json")] + [InlineData(TraktExtendedInfo.Full | TraktExtendedInfo.Images, $"{GetMovieUri}/293990?extended=full,images", "Movies\\movie_full_images.json")] public async Task TestGetMovieWithID(TraktExtendedInfo? extendedInfo, string requestUri, string responseContentFile) { string responseContent = await TestUtility.GetJsonFileContentAsync(responseContentFile); @@ -36,7 +37,8 @@ public async Task TestGetMovieWithID(TraktExtendedInfo? extendedInfo, string req [Theory] [InlineData(null, GetMovieUriWithSlug, "Movies\\movie_minimal.json")] [InlineData(TraktExtendedInfo.None, GetMovieUriWithSlug, "Movies\\movie_minimal.json")] - [InlineData(TraktExtendedInfo.Full, $"{GetMovieUriWithSlug}?extended=full", "Movies\\movie.json")] + [InlineData(TraktExtendedInfo.Full, $"{GetMovieUriWithSlug}?extended=full", "Movies\\movie_full.json")] + [InlineData(TraktExtendedInfo.Full | TraktExtendedInfo.Images, $"{GetMovieUriWithSlug}?extended=full,images", "Movies\\movie_full_images.json")] public async Task TestGetMovieWithSlug(TraktExtendedInfo? extendedInfo, string requestUri, string responseContentFile) { string responseContent = await TestUtility.GetJsonFileContentAsync(responseContentFile); @@ -62,7 +64,8 @@ public async Task TestGetMovieWithSlug(TraktExtendedInfo? extendedInfo, string r [Theory] [InlineData(null, GetMovieUriWithSlug, "Movies\\movie_minimal.json")] [InlineData(TraktExtendedInfo.None, GetMovieUriWithSlug, "Movies\\movie_minimal.json")] - [InlineData(TraktExtendedInfo.Full, $"{GetMovieUriWithSlug}?extended=full", "Movies\\movie.json")] + [InlineData(TraktExtendedInfo.Full, $"{GetMovieUriWithSlug}?extended=full", "Movies\\movie_full.json")] + [InlineData(TraktExtendedInfo.Full | TraktExtendedInfo.Images, $"{GetMovieUriWithSlug}?extended=full,images", "Movies\\movie_full_images.json")] public async Task TestGetMovieWithIDs(TraktExtendedInfo? extendedInfo, string requestUri, string responseContentFile) { string responseContent = await TestUtility.GetJsonFileContentAsync(responseContentFile);