public async Task Test_ListItemObjectJsonReader_Show_ReadObject_From_JsonReader_Incomplete_5() { var traktJsonReader = new ListItemObjectJsonReader(); using (var reader = new StringReader(TYPE_SHOW_JSON_INCOMPLETE_5)) using (var jsonReader = new JsonTextReader(reader)) { var traktListItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktListItem.Should().NotBeNull(); traktListItem.Rank.Should().Be("1"); traktListItem.ListedAt.Should().BeNull(); traktListItem.Type.Should().BeNull(); traktListItem.Show.Should().BeNull(); traktListItem.Movie.Should().BeNull(); traktListItem.Season.Should().BeNull(); traktListItem.Episode.Should().BeNull(); traktListItem.Person.Should().BeNull(); } }
public async Task Test_ListItemObjectJsonReader_Show_ReadObject_From_JsonReader_Incomplete_4() { var traktJsonReader = new ListItemObjectJsonReader(); using (var reader = new StringReader(TYPE_SHOW_JSON_INCOMPLETE_4)) using (var jsonReader = new JsonTextReader(reader)) { var traktListItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktListItem.Should().NotBeNull(); traktListItem.Rank.Should().Be("1"); traktListItem.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktListItem.Type.Should().Be(TraktListItemType.Show); traktListItem.Show.Should().BeNull(); traktListItem.Movie.Should().BeNull(); traktListItem.Season.Should().BeNull(); traktListItem.Episode.Should().BeNull(); traktListItem.Person.Should().BeNull(); } }
public async Task Test_ListItemObjectJsonReader_Episode_ReadObject_From_JsonReader_Complete() { var traktJsonReader = new ListItemObjectJsonReader(); using (var reader = new StringReader(TYPE_EPISODE_JSON_COMPLETE)) using (var jsonReader = new JsonTextReader(reader)) { var traktListItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktListItem.Should().NotBeNull(); traktListItem.Id.Should().Be(101U); traktListItem.Rank.Should().Be("1"); traktListItem.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktListItem.Type.Should().Be(TraktListItemType.Episode); traktListItem.Episode.Should().NotBeNull(); traktListItem.Episode.SeasonNumber.Should().Be(1); traktListItem.Episode.Number.Should().Be(1); traktListItem.Episode.Title.Should().Be("Winter Is Coming"); traktListItem.Episode.Ids.Should().NotBeNull(); traktListItem.Episode.Ids.Trakt.Should().Be(73640U); traktListItem.Episode.Ids.Tvdb.Should().Be(3254641U); traktListItem.Episode.Ids.Imdb.Should().Be("tt1480055"); traktListItem.Episode.Ids.Tmdb.Should().Be(63056U); traktListItem.Episode.Ids.TvRage.Should().Be(1065008299U); traktListItem.Show.Should().NotBeNull(); traktListItem.Show.Title.Should().Be("Game of Thrones"); traktListItem.Show.Year.Should().Be(2011); traktListItem.Show.Ids.Should().NotBeNull(); traktListItem.Show.Ids.Trakt.Should().Be(1390U); traktListItem.Show.Ids.Slug.Should().Be("game-of-thrones"); traktListItem.Show.Ids.Tvdb.Should().Be(121361U); traktListItem.Show.Ids.Imdb.Should().Be("tt0944947"); traktListItem.Show.Ids.Tmdb.Should().Be(1399U); traktListItem.Show.Ids.TvRage.Should().Be(24493U); traktListItem.Movie.Should().BeNull(); traktListItem.Season.Should().BeNull(); traktListItem.Person.Should().BeNull(); } }
public async Task Test_ListItemObjectJsonReader_Episode_ReadObject_From_JsonReader_Not_Valid_2() { var traktJsonReader = new ListItemObjectJsonReader(); using (var reader = new StringReader(TYPE_EPISODE_JSON_NOT_VALID_2)) using (var jsonReader = new JsonTextReader(reader)) { var traktListItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktListItem.Should().NotBeNull(); traktListItem.Rank.Should().Be("1"); traktListItem.ListedAt.Should().BeNull(); traktListItem.Type.Should().Be(TraktListItemType.Episode); traktListItem.Episode.Should().NotBeNull(); traktListItem.Episode.SeasonNumber.Should().Be(1); traktListItem.Episode.Number.Should().Be(1); traktListItem.Episode.Title.Should().Be("Winter Is Coming"); traktListItem.Episode.Ids.Should().NotBeNull(); traktListItem.Episode.Ids.Trakt.Should().Be(73640U); traktListItem.Episode.Ids.Tvdb.Should().Be(3254641U); traktListItem.Episode.Ids.Imdb.Should().Be("tt1480055"); traktListItem.Episode.Ids.Tmdb.Should().Be(63056U); traktListItem.Episode.Ids.TvRage.Should().Be(1065008299U); traktListItem.Show.Should().NotBeNull(); traktListItem.Show.Title.Should().Be("Game of Thrones"); traktListItem.Show.Year.Should().Be(2011); traktListItem.Show.Ids.Should().NotBeNull(); traktListItem.Show.Ids.Trakt.Should().Be(1390U); traktListItem.Show.Ids.Slug.Should().Be("game-of-thrones"); traktListItem.Show.Ids.Tvdb.Should().Be(121361U); traktListItem.Show.Ids.Imdb.Should().Be("tt0944947"); traktListItem.Show.Ids.Tmdb.Should().Be(1399U); traktListItem.Show.Ids.TvRage.Should().Be(24493U); traktListItem.Movie.Should().BeNull(); traktListItem.Season.Should().BeNull(); traktListItem.Person.Should().BeNull(); } }
public async Task Test_ListItemObjectJsonReader_Episode_ReadObject_From_Stream_Incomplete_2() { var jsonReader = new ListItemObjectJsonReader(); using (var stream = TYPE_EPISODE_JSON_INCOMPLETE_2.ToStream()) { var traktListItem = await jsonReader.ReadObjectAsync(stream); traktListItem.Should().NotBeNull(); traktListItem.Rank.Should().Be("1"); traktListItem.ListedAt.Should().BeNull(); traktListItem.Type.Should().Be(TraktListItemType.Episode); traktListItem.Episode.Should().NotBeNull(); traktListItem.Episode.SeasonNumber.Should().Be(1); traktListItem.Episode.Number.Should().Be(1); traktListItem.Episode.Title.Should().Be("Winter Is Coming"); traktListItem.Episode.Ids.Should().NotBeNull(); traktListItem.Episode.Ids.Trakt.Should().Be(73640U); traktListItem.Episode.Ids.Tvdb.Should().Be(3254641U); traktListItem.Episode.Ids.Imdb.Should().Be("tt1480055"); traktListItem.Episode.Ids.Tmdb.Should().Be(63056U); traktListItem.Episode.Ids.TvRage.Should().Be(1065008299U); traktListItem.Show.Should().NotBeNull(); traktListItem.Show.Title.Should().Be("Game of Thrones"); traktListItem.Show.Year.Should().Be(2011); traktListItem.Show.Ids.Should().NotBeNull(); traktListItem.Show.Ids.Trakt.Should().Be(1390U); traktListItem.Show.Ids.Slug.Should().Be("game-of-thrones"); traktListItem.Show.Ids.Tvdb.Should().Be(121361U); traktListItem.Show.Ids.Imdb.Should().Be("tt0944947"); traktListItem.Show.Ids.Tmdb.Should().Be(1399U); traktListItem.Show.Ids.TvRage.Should().Be(24493U); traktListItem.Movie.Should().BeNull(); traktListItem.Season.Should().BeNull(); traktListItem.Person.Should().BeNull(); } }
public async Task Test_ListItemObjectJsonReader_Season_ReadObject_From_Json_String_Incomplete_3() { var jsonReader = new ListItemObjectJsonReader(); var traktListItem = await jsonReader.ReadObjectAsync(TYPE_SEASON_JSON_INCOMPLETE_3); traktListItem.Should().NotBeNull(); traktListItem.Rank.Should().Be("1"); traktListItem.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktListItem.Type.Should().BeNull(); traktListItem.Season.Should().NotBeNull(); traktListItem.Season.Number.Should().Be(1); traktListItem.Season.Ids.Should().NotBeNull(); traktListItem.Season.Ids.Trakt.Should().Be(61430U); traktListItem.Season.Ids.Tvdb.Should().Be(279121U); traktListItem.Season.Ids.Tmdb.Should().Be(60523U); traktListItem.Season.Ids.TvRage.Should().Be(36939U); traktListItem.Movie.Should().BeNull(); traktListItem.Show.Should().BeNull(); traktListItem.Episode.Should().BeNull(); traktListItem.Person.Should().BeNull(); }
public async Task Test_ListItemObjectJsonReader_Season_ReadObject_From_Json_String_Incomplete_2() { var jsonReader = new ListItemObjectJsonReader(); var traktListItem = await jsonReader.ReadObjectAsync(TYPE_SEASON_JSON_INCOMPLETE_2); traktListItem.Should().NotBeNull(); traktListItem.Rank.Should().Be("1"); traktListItem.ListedAt.Should().BeNull(); traktListItem.Type.Should().Be(TraktListItemType.Season); traktListItem.Season.Should().NotBeNull(); traktListItem.Season.Number.Should().Be(1); traktListItem.Season.Ids.Should().NotBeNull(); traktListItem.Season.Ids.Trakt.Should().Be(61430U); traktListItem.Season.Ids.Tvdb.Should().Be(279121U); traktListItem.Season.Ids.Tmdb.Should().Be(60523U); traktListItem.Season.Ids.TvRage.Should().Be(36939U); traktListItem.Movie.Should().BeNull(); traktListItem.Show.Should().BeNull(); traktListItem.Episode.Should().BeNull(); traktListItem.Person.Should().BeNull(); }
public async Task Test_ListItemObjectJsonReader_Person_ReadObject_From_Json_String_Not_Valid_2() { var jsonReader = new ListItemObjectJsonReader(); var traktListItem = await jsonReader.ReadObjectAsync(TYPE_PERSON_JSON_NOT_VALID_2); traktListItem.Should().NotBeNull(); traktListItem.Rank.Should().Be("1"); traktListItem.ListedAt.Should().BeNull(); traktListItem.Type.Should().Be(TraktListItemType.Person); traktListItem.Person.Should().NotBeNull(); traktListItem.Person.Name.Should().Be("Bryan Cranston"); traktListItem.Person.Ids.Should().NotBeNull(); traktListItem.Person.Ids.Trakt.Should().Be(297737U); traktListItem.Person.Ids.Slug.Should().Be("bryan-cranston"); traktListItem.Person.Ids.Imdb.Should().Be("nm0186505"); traktListItem.Person.Ids.Tmdb.Should().Be(17419U); traktListItem.Person.Ids.TvRage.Should().Be(1797U); traktListItem.Movie.Should().BeNull(); traktListItem.Show.Should().BeNull(); traktListItem.Season.Should().BeNull(); traktListItem.Episode.Should().BeNull(); }
public async Task Test_ListItemObjectJsonReader_Movie_ReadObject_From_Json_String_Incomplete_3() { var jsonReader = new ListItemObjectJsonReader(); var traktListItem = await jsonReader.ReadObjectAsync(TYPE_MOVIE_JSON_INCOMPLETE_3); traktListItem.Should().NotBeNull(); traktListItem.Rank.Should().Be("1"); traktListItem.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktListItem.Type.Should().BeNull(); traktListItem.Movie.Should().NotBeNull(); traktListItem.Movie.Title.Should().Be("Star Wars: The Force Awakens"); traktListItem.Movie.Year.Should().Be(2015); traktListItem.Movie.Ids.Should().NotBeNull(); traktListItem.Movie.Ids.Trakt.Should().Be(94024U); traktListItem.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); traktListItem.Movie.Ids.Imdb.Should().Be("tt2488496"); traktListItem.Movie.Ids.Tmdb.Should().Be(140607U); traktListItem.Show.Should().BeNull(); traktListItem.Season.Should().BeNull(); traktListItem.Episode.Should().BeNull(); traktListItem.Person.Should().BeNull(); }
public async Task Test_TraktListItem_With_Type_Movie_From_Full_Json() { var jsonReader = new ListItemObjectJsonReader(); var listItem = await jsonReader.ReadObjectAsync(TYPE_MOVIE_FULL_JSON) as TraktListItem; listItem.Should().NotBeNull(); listItem.Id.Should().Be(101U); listItem.Rank.Should().Be("1"); listItem.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); listItem.Type.Should().Be(TraktListItemType.Movie); listItem.Movie.Should().NotBeNull(); listItem.Movie.Title.Should().Be("Star Wars: The Force Awakens"); listItem.Movie.Year.Should().Be(2015); listItem.Movie.Ids.Should().NotBeNull(); listItem.Movie.Ids.Trakt.Should().Be(94024U); listItem.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); listItem.Movie.Ids.Imdb.Should().Be("tt2488496"); listItem.Movie.Ids.Tmdb.Should().Be(140607U); listItem.Movie.Tagline.Should().Be("Every generation has a story."); listItem.Movie.Overview.Should().Be("Thirty years after defeating the Galactic Empire, Han Solo and his allies face a new threat from the evil Kylo Ren and his army of Stormtroopers."); listItem.Movie.Released.Should().Be(DateTime.Parse("2015-12-18")); listItem.Movie.Runtime.Should().Be(136); listItem.Movie.UpdatedAt.Should().Be(DateTime.Parse("2016-03-31T09:01:59Z").ToUniversalTime()); listItem.Movie.Trailer.Should().Be("http://youtube.com/watch?v=uwa7N0ShN2U"); listItem.Movie.Homepage.Should().Be("http://www.starwars.com/films/star-wars-episode-vii"); listItem.Movie.Rating.Should().Be(8.31988f); listItem.Movie.Votes.Should().Be(9338); listItem.Movie.LanguageCode.Should().Be("en"); listItem.Movie.AvailableTranslationLanguageCodes.Should().NotBeNull().And.HaveCount(4).And.Contain("en", "de", "en", "it"); listItem.Movie.Genres.Should().NotBeNull().And.HaveCount(4).And.Contain("action", "adventure", "fantasy", "science-fiction"); listItem.Movie.Certification.Should().Be("PG-13"); listItem.Show.Should().BeNull(); listItem.Season.Should().BeNull(); listItem.Episode.Should().BeNull(); listItem.Person.Should().BeNull(); }
public async Task Test_ListItemObjectJsonReader_Movie_ReadObject_From_Json_String_Not_Valid_2() { var jsonReader = new ListItemObjectJsonReader(); var traktListItem = await jsonReader.ReadObjectAsync(TYPE_MOVIE_JSON_NOT_VALID_2); traktListItem.Should().NotBeNull(); traktListItem.Rank.Should().Be("1"); traktListItem.ListedAt.Should().BeNull(); traktListItem.Type.Should().Be(TraktListItemType.Movie); traktListItem.Movie.Should().NotBeNull(); traktListItem.Movie.Title.Should().Be("Star Wars: The Force Awakens"); traktListItem.Movie.Year.Should().Be(2015); traktListItem.Movie.Ids.Should().NotBeNull(); traktListItem.Movie.Ids.Trakt.Should().Be(94024U); traktListItem.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); traktListItem.Movie.Ids.Imdb.Should().Be("tt2488496"); traktListItem.Movie.Ids.Tmdb.Should().Be(140607U); traktListItem.Show.Should().BeNull(); traktListItem.Season.Should().BeNull(); traktListItem.Episode.Should().BeNull(); traktListItem.Person.Should().BeNull(); }
public async Task Test_ListItemObjectJsonReader_Person_ReadObject_From_Json_String_Incomplete_3() { var jsonReader = new ListItemObjectJsonReader(); var traktListItem = await jsonReader.ReadObjectAsync(TYPE_PERSON_JSON_INCOMPLETE_3); traktListItem.Should().NotBeNull(); traktListItem.Rank.Should().Be("1"); traktListItem.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktListItem.Type.Should().BeNull(); traktListItem.Person.Should().NotBeNull(); traktListItem.Person.Name.Should().Be("Bryan Cranston"); traktListItem.Person.Ids.Should().NotBeNull(); traktListItem.Person.Ids.Trakt.Should().Be(297737U); traktListItem.Person.Ids.Slug.Should().Be("bryan-cranston"); traktListItem.Person.Ids.Imdb.Should().Be("nm0186505"); traktListItem.Person.Ids.Tmdb.Should().Be(17419U); traktListItem.Person.Ids.TvRage.Should().Be(1797U); traktListItem.Movie.Should().BeNull(); traktListItem.Show.Should().BeNull(); traktListItem.Season.Should().BeNull(); traktListItem.Episode.Should().BeNull(); }
public async Task Test_TraktListItem_With_Type_Movie_From_Minimal_Json() { var jsonReader = new ListItemObjectJsonReader(); var listItem = await jsonReader.ReadObjectAsync(TYPE_MOVIE_MINIMAL_JSON) as TraktListItem; listItem.Should().NotBeNull(); listItem.Id.Should().Be(101U); listItem.Rank.Should().Be("1"); listItem.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); listItem.Type.Should().Be(TraktListItemType.Movie); listItem.Movie.Should().NotBeNull(); listItem.Movie.Title.Should().Be("Star Wars: The Force Awakens"); listItem.Movie.Year.Should().Be(2015); listItem.Movie.Ids.Should().NotBeNull(); listItem.Movie.Ids.Trakt.Should().Be(94024U); listItem.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); listItem.Movie.Ids.Imdb.Should().Be("tt2488496"); listItem.Movie.Ids.Tmdb.Should().Be(140607U); listItem.Movie.Tagline.Should().BeNullOrEmpty(); listItem.Movie.Overview.Should().BeNullOrEmpty(); listItem.Movie.Released.Should().NotHaveValue(); listItem.Movie.Runtime.Should().NotHaveValue(); listItem.Movie.UpdatedAt.Should().NotHaveValue(); listItem.Movie.Trailer.Should().BeNullOrEmpty(); listItem.Movie.Homepage.Should().BeNullOrEmpty(); listItem.Movie.Rating.Should().NotHaveValue(); listItem.Movie.Votes.Should().NotHaveValue(); listItem.Movie.LanguageCode.Should().BeNullOrEmpty(); listItem.Movie.AvailableTranslationLanguageCodes.Should().BeNull(); listItem.Movie.Genres.Should().BeNull(); listItem.Movie.Certification.Should().BeNullOrEmpty(); listItem.Show.Should().BeNull(); listItem.Season.Should().BeNull(); listItem.Episode.Should().BeNull(); listItem.Person.Should().BeNull(); }
public async Task Test_ListItemObjectJsonReader_ReadObject_From_Stream_Null() { var jsonReader = new ListItemObjectJsonReader(); Func <Task <ITraktListItem> > traktListItem = () => jsonReader.ReadObjectAsync(default(Stream)); await traktListItem.Should().ThrowAsync <ArgumentNullException>(); }
public async Task Test_TraktListItem_With_Type_Episode_From_Minimal_Json() { var jsonReader = new ListItemObjectJsonReader(); var listItem = await jsonReader.ReadObjectAsync(TYPE_EPISODE_MINIMAL_JSON) as TraktListItem; listItem.Should().NotBeNull(); listItem.Id.Should().Be(101U); listItem.Rank.Should().Be("1"); listItem.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); listItem.Type.Should().Be(TraktListItemType.Episode); listItem.Movie.Should().BeNull(); listItem.Show.Should().NotBeNull(); listItem.Show.Title.Should().Be("Game of Thrones"); listItem.Show.Year.Should().Be(2011); listItem.Show.Airs.Should().BeNull(); listItem.Show.AvailableTranslationLanguageCodes.Should().BeNull(); listItem.Show.Ids.Should().NotBeNull(); listItem.Show.Ids.Trakt.Should().Be(1390U); listItem.Show.Ids.Slug.Should().Be("game-of-thrones"); listItem.Show.Ids.Tvdb.Should().Be(121361U); listItem.Show.Ids.Imdb.Should().Be("tt0944947"); listItem.Show.Ids.Tmdb.Should().Be(1399U); listItem.Show.Ids.TvRage.Should().Be(24493U); listItem.Show.Genres.Should().BeNull(); listItem.Show.Seasons.Should().BeNull(); listItem.Show.Overview.Should().BeNullOrEmpty(); listItem.Show.FirstAired.Should().NotHaveValue(); listItem.Show.Runtime.Should().NotHaveValue(); listItem.Show.Certification.Should().BeNullOrEmpty(); listItem.Show.Network.Should().BeNullOrEmpty(); listItem.Show.CountryCode.Should().BeNullOrEmpty(); listItem.Show.UpdatedAt.Should().NotHaveValue(); listItem.Show.Trailer.Should().BeNullOrEmpty(); listItem.Show.Homepage.Should().BeNullOrEmpty(); listItem.Show.Status.Should().BeNull(); listItem.Show.Rating.Should().NotHaveValue(); listItem.Show.Votes.Should().NotHaveValue(); listItem.Show.LanguageCode.Should().BeNullOrEmpty(); listItem.Show.AiredEpisodes.Should().NotHaveValue(); listItem.Season.Should().BeNull(); listItem.Episode.Should().NotBeNull(); listItem.Episode.SeasonNumber.Should().Be(1); listItem.Episode.Number.Should().Be(1); listItem.Episode.Title.Should().Be("Winter Is Coming"); listItem.Episode.Ids.Should().NotBeNull(); listItem.Episode.Ids.Trakt.Should().Be(73640U); listItem.Episode.Ids.Tvdb.Should().Be(3254641U); listItem.Episode.Ids.Imdb.Should().Be("tt1480055"); listItem.Episode.Ids.Tmdb.Should().Be(63056U); listItem.Episode.Ids.TvRage.Should().Be(1065008299U); listItem.Episode.NumberAbsolute.Should().NotHaveValue(); listItem.Episode.Overview.Should().BeNullOrEmpty(); listItem.Episode.Runtime.Should().NotHaveValue(); listItem.Episode.Rating.Should().NotHaveValue(); listItem.Episode.Votes.Should().NotHaveValue(); listItem.Episode.FirstAired.Should().NotHaveValue(); listItem.Episode.UpdatedAt.Should().NotHaveValue(); listItem.Episode.AvailableTranslationLanguageCodes.Should().BeNull(); listItem.Episode.Translations.Should().BeNull(); listItem.Person.Should().BeNull(); }
public async Task Test_TraktListItem_With_Type_Episode_From_Full_Json() { var jsonReader = new ListItemObjectJsonReader(); var listItem = await jsonReader.ReadObjectAsync(TYPE_EPISODE_FULL_JSON) as TraktListItem; listItem.Should().NotBeNull(); listItem.Id.Should().Be(101U); listItem.Rank.Should().Be("1"); listItem.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); listItem.Type.Should().Be(TraktListItemType.Episode); listItem.Movie.Should().BeNull(); listItem.Show.Should().NotBeNull(); listItem.Show.Title.Should().Be("Game of Thrones"); listItem.Show.Year.Should().Be(2011); listItem.Show.Airs.Should().NotBeNull(); listItem.Show.Airs.Day.Should().Be("Sunday"); listItem.Show.Airs.Time.Should().Be("21:00"); listItem.Show.Airs.TimeZoneId.Should().Be("America/New_York"); listItem.Show.AvailableTranslationLanguageCodes.Should().NotBeNull().And.HaveCount(4).And.Contain("en", "fr", "it", "de"); listItem.Show.Ids.Should().NotBeNull(); listItem.Show.Ids.Trakt.Should().Be(1390U); listItem.Show.Ids.Slug.Should().Be("game-of-thrones"); listItem.Show.Ids.Tvdb.Should().Be(121361U); listItem.Show.Ids.Imdb.Should().Be("tt0944947"); listItem.Show.Ids.Tmdb.Should().Be(1399U); listItem.Show.Ids.TvRage.Should().Be(24493U); listItem.Show.Genres.Should().NotBeNull().And.HaveCount(5).And.Contain("drama", "fantasy", "science-fiction", "action", "adventure"); listItem.Show.Seasons.Should().BeNull(); listItem.Show.Overview.Should().Be("Seven noble families fight for control of the mythical land of Westeros. Friction between the houses leads to full-scale war. All while a very ancient evil awakens in the farthest north. Amidst the war, a neglected military order of misfits, the Night's Watch, is all that stands between the realms of men and the icy horrors beyond."); listItem.Show.FirstAired.Should().Be(DateTime.Parse("2011-04-17T07:00:00Z").ToUniversalTime()); listItem.Show.Runtime.Should().Be(60); listItem.Show.Certification.Should().Be("TV-MA"); listItem.Show.Network.Should().Be("HBO"); listItem.Show.CountryCode.Should().Be("us"); listItem.Show.UpdatedAt.Should().Be(DateTime.Parse("2016-04-06T10:39:11Z").ToUniversalTime()); listItem.Show.Trailer.Should().Be("http://youtube.com/watch?v=F9Bo89m2f6g"); listItem.Show.Homepage.Should().Be("http://www.hbo.com/game-of-thrones"); listItem.Show.Status.Should().Be(TraktShowStatus.ReturningSeries); listItem.Show.Rating.Should().Be(9.38327f); listItem.Show.Votes.Should().Be(44773); listItem.Show.LanguageCode.Should().Be("en"); listItem.Show.AiredEpisodes.Should().Be(50); listItem.Season.Should().BeNull(); listItem.Episode.Should().NotBeNull(); listItem.Episode.SeasonNumber.Should().Be(1); listItem.Episode.Number.Should().Be(1); listItem.Episode.Title.Should().Be("Winter Is Coming"); listItem.Episode.Ids.Should().NotBeNull(); listItem.Episode.Ids.Trakt.Should().Be(73640U); listItem.Episode.Ids.Tvdb.Should().Be(3254641U); listItem.Episode.Ids.Imdb.Should().Be("tt1480055"); listItem.Episode.Ids.Tmdb.Should().Be(63056U); listItem.Episode.Ids.TvRage.Should().Be(1065008299U); listItem.Episode.NumberAbsolute.Should().Be(50); listItem.Episode.Overview.Should().Be("Ned Stark, Lord of Winterfell learns that his mentor, Jon Arryn, has died and that King Robert is on his way north to offer Ned Arryn’s position as the King’s Hand. Across the Narrow Sea in Pentos, Viserys Targaryen plans to wed his sister Daenerys to the nomadic Dothraki warrior leader, Khal Drogo to forge an alliance to take the throne."); listItem.Episode.Runtime.Should().Be(55); listItem.Episode.Rating.Should().Be(9.0f); listItem.Episode.Votes.Should().Be(111); listItem.Episode.FirstAired.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime()); listItem.Episode.UpdatedAt.Should().Be(DateTime.Parse("2014-08-29T23:16:39.000Z").ToUniversalTime()); listItem.Episode.AvailableTranslationLanguageCodes.Should().NotBeNull().And.HaveCount(2).And.Contain("en", "es"); listItem.Episode.Translations.Should().NotBeNull().And.HaveCount(2); var translations = listItem.Episode.Translations.ToArray(); translations[0].Should().NotBeNull(); translations[0].Title.Should().Be("Winter Is Coming"); translations[0].Overview.Should().Be("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."); translations[0].LanguageCode.Should().Be("en"); translations[1].Should().NotBeNull(); translations[1].Title.Should().Be("Se acerca el invierno"); translations[1].Overview.Should().Be("El Lord Ned Stark está preocupado por los perturbantes reportes de un desertor del Nights Watch; El Rey Robert y los Lannisters llegan a Winterfell; el exiliado Viserys Targaryen forja una nueva y poderosa alianza."); translations[1].LanguageCode.Should().Be("es"); listItem.Person.Should().BeNull(); }
public async Task Test_TraktListItem_With_Type_Season_From_Full_Json() { var jsonReader = new ListItemObjectJsonReader(); var listItem = await jsonReader.ReadObjectAsync(TYPE_SEASON_FULL_JSON) as TraktListItem; listItem.Should().NotBeNull(); listItem.Id.Should().Be(101U); listItem.Rank.Should().Be("1"); listItem.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); listItem.Type.Should().Be(TraktListItemType.Season); listItem.Movie.Should().BeNull(); listItem.Show.Should().BeNull(); listItem.Season.Should().NotBeNull(); listItem.Season.Number.Should().Be(1); listItem.Season.Ids.Should().NotBeNull(); listItem.Season.Ids.Trakt.Should().Be(61430U); listItem.Season.Ids.Tvdb.Should().Be(279121U); listItem.Season.Ids.Tmdb.Should().Be(60523U); listItem.Season.Ids.TvRage.Should().Be(36939U); listItem.Season.Rating.Should().Be(8.57053f); listItem.Season.Votes.Should().Be(794); listItem.Season.TotalEpisodesCount.Should().Be(23); listItem.Season.AiredEpisodesCount.Should().Be(23); listItem.Season.Overview.Should().Be("Text text text"); listItem.Season.FirstAired.Should().Be(DateTime.Parse("2014-10-08T00:00:00.000Z").ToUniversalTime()); listItem.Season.Episodes.Should().NotBeNull().And.HaveCount(2); var episodes = listItem.Season.Episodes.ToArray(); episodes[0].Should().NotBeNull(); episodes[0].SeasonNumber.Should().Be(1); episodes[0].Number.Should().Be(1); episodes[0].Title.Should().Be("Winter Is Coming"); episodes[0].Ids.Should().NotBeNull(); episodes[0].Ids.Trakt.Should().Be(73640U); episodes[0].Ids.Tvdb.Should().Be(3254641U); episodes[0].Ids.Imdb.Should().Be("tt1480055"); episodes[0].Ids.Tmdb.Should().Be(63056U); episodes[0].Ids.TvRage.Should().Be(1065008299U); episodes[0].NumberAbsolute.Should().NotHaveValue(); episodes[0].Overview.Should().BeNullOrEmpty(); episodes[0].Runtime.Should().NotHaveValue(); episodes[0].Rating.Should().NotHaveValue(); episodes[0].Votes.Should().NotHaveValue(); episodes[0].FirstAired.Should().NotHaveValue(); episodes[0].UpdatedAt.Should().NotHaveValue(); episodes[0].AvailableTranslationLanguageCodes.Should().BeNull(); episodes[0].Translations.Should().BeNull(); episodes[1].Should().NotBeNull(); episodes[1].SeasonNumber.Should().Be(1); episodes[1].Number.Should().Be(2); episodes[1].Title.Should().Be("The Kingsroad"); episodes[1].Ids.Should().NotBeNull(); episodes[1].Ids.Trakt.Should().Be(74138U); episodes[1].Ids.Tvdb.Should().Be(3436411U); episodes[1].Ids.Imdb.Should().Be("tt1668746"); episodes[1].Ids.Tmdb.Should().Be(63141U); episodes[1].Ids.TvRage.Should().Be(1325718577U); episodes[1].NumberAbsolute.Should().NotHaveValue(); episodes[1].Overview.Should().BeNullOrEmpty(); episodes[1].Runtime.Should().NotHaveValue(); episodes[1].Rating.Should().NotHaveValue(); episodes[1].Votes.Should().NotHaveValue(); episodes[1].FirstAired.Should().NotHaveValue(); episodes[1].UpdatedAt.Should().NotHaveValue(); episodes[1].AvailableTranslationLanguageCodes.Should().BeNull(); episodes[1].Translations.Should().BeNull(); listItem.Episode.Should().BeNull(); listItem.Person.Should().BeNull(); }