public async Task Test_SearchResultObjectJsonReader_Show_ReadObject_From_JsonReader_Not_Valid_2() { var traktJsonReader = new SearchResultObjectJsonReader(); using (var reader = new StringReader(TYPE_SHOW_JSON_NOT_VALID_2)) using (var jsonReader = new JsonTextReader(reader)) { var traktSearchResultItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Show); traktSearchResultItem.Score.Should().BeNull(); traktSearchResultItem.Show.Should().NotBeNull(); traktSearchResultItem.Show.Title.Should().Be("Game of Thrones"); traktSearchResultItem.Show.Year.Should().Be(2011); traktSearchResultItem.Show.Ids.Should().NotBeNull(); traktSearchResultItem.Show.Ids.Trakt.Should().Be(1390U); traktSearchResultItem.Show.Ids.Slug.Should().Be("game-of-thrones"); traktSearchResultItem.Show.Ids.Tvdb.Should().Be(121361U); traktSearchResultItem.Show.Ids.Imdb.Should().Be("tt0944947"); traktSearchResultItem.Show.Ids.Tmdb.Should().Be(1399U); traktSearchResultItem.Show.Ids.TvRage.Should().Be(24493U); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_Episode_ReadObject_From_JsonReader_Incomplete_8() { var traktJsonReader = new SearchResultObjectJsonReader(); using (var reader = new StringReader(TYPE_EPISODE_JSON_INCOMPLETE_8)) using (var jsonReader = new JsonTextReader(reader)) { var traktSearchResultItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().BeNull(); traktSearchResultItem.Score.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.Show.Should().NotBeNull(); traktSearchResultItem.Show.Title.Should().Be("Game of Thrones"); traktSearchResultItem.Show.Year.Should().Be(2011); traktSearchResultItem.Show.Ids.Should().NotBeNull(); traktSearchResultItem.Show.Ids.Trakt.Should().Be(1390U); traktSearchResultItem.Show.Ids.Slug.Should().Be("game-of-thrones"); traktSearchResultItem.Show.Ids.Tvdb.Should().Be(121361U); traktSearchResultItem.Show.Ids.Imdb.Should().Be("tt0944947"); traktSearchResultItem.Show.Ids.Tmdb.Should().Be(1399U); traktSearchResultItem.Show.Ids.TvRage.Should().Be(24493U); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); } }
public async Task Test_TraktSearchResult_With_Type_Episode_From_Minimal_Json() { var jsonReader = new SearchResultObjectJsonReader(); var traktSearchResultItem = await jsonReader.ReadObjectAsync(TYPE_EPISODE_JSON) as TraktSearchResult; traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Episode); traktSearchResultItem.Score.Should().Be(46.29501f); traktSearchResultItem.Episode.Should().NotBeNull(); traktSearchResultItem.Episode.SeasonNumber.Should().Be(1); traktSearchResultItem.Episode.Number.Should().Be(1); traktSearchResultItem.Episode.Title.Should().Be("Winter Is Coming"); traktSearchResultItem.Episode.Ids.Should().NotBeNull(); traktSearchResultItem.Episode.Ids.Trakt.Should().Be(73640U); traktSearchResultItem.Episode.Ids.Tvdb.Should().Be(3254641U); traktSearchResultItem.Episode.Ids.Imdb.Should().Be("tt1480055"); traktSearchResultItem.Episode.Ids.Tmdb.Should().Be(63056U); traktSearchResultItem.Episode.Ids.TvRage.Should().Be(1065008299U); traktSearchResultItem.Show.Should().NotBeNull(); traktSearchResultItem.Show.Title.Should().Be("Game of Thrones"); traktSearchResultItem.Show.Year.Should().Be(2011); traktSearchResultItem.Show.Ids.Should().NotBeNull(); traktSearchResultItem.Show.Ids.Trakt.Should().Be(1390U); traktSearchResultItem.Show.Ids.Slug.Should().Be("game-of-thrones"); traktSearchResultItem.Show.Ids.Tvdb.Should().Be(121361U); traktSearchResultItem.Show.Ids.Imdb.Should().Be("tt0944947"); traktSearchResultItem.Show.Ids.Tmdb.Should().Be(1399U); traktSearchResultItem.Show.Ids.TvRage.Should().Be(24493U); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); }
public async Task Test_SearchResultObjectJsonReader_Movie_ReadObject_From_Stream_Incomplete_2() { var jsonReader = new SearchResultObjectJsonReader(); using (var stream = TYPE_MOVIE_JSON_INCOMPLETE_2.ToStream()) { var traktSearchResultItem = await jsonReader.ReadObjectAsync(stream); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Movie); traktSearchResultItem.Score.Should().BeNull(); traktSearchResultItem.Movie.Should().NotBeNull(); traktSearchResultItem.Movie.Title.Should().Be("Star Wars: The Force Awakens"); traktSearchResultItem.Movie.Year.Should().Be(2015); traktSearchResultItem.Movie.Ids.Should().NotBeNull(); traktSearchResultItem.Movie.Ids.Trakt.Should().Be(94024U); traktSearchResultItem.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); traktSearchResultItem.Movie.Ids.Imdb.Should().Be("tt2488496"); traktSearchResultItem.Movie.Ids.Tmdb.Should().Be(140607U); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_Episode_ReadObject_From_Stream_Not_Valid_4() { var jsonReader = new SearchResultObjectJsonReader(); using (var stream = TYPE_EPISODE_JSON_NOT_VALID_4.ToStream()) { var traktSearchResultItem = await jsonReader.ReadObjectAsync(stream); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Episode); traktSearchResultItem.Score.Should().Be(46.29501f); traktSearchResultItem.Episode.Should().NotBeNull(); traktSearchResultItem.Episode.SeasonNumber.Should().Be(1); traktSearchResultItem.Episode.Number.Should().Be(1); traktSearchResultItem.Episode.Title.Should().Be("Winter Is Coming"); traktSearchResultItem.Episode.Ids.Should().NotBeNull(); traktSearchResultItem.Episode.Ids.Trakt.Should().Be(73640U); traktSearchResultItem.Episode.Ids.Tvdb.Should().Be(3254641U); traktSearchResultItem.Episode.Ids.Imdb.Should().Be("tt1480055"); traktSearchResultItem.Episode.Ids.Tmdb.Should().Be(63056U); traktSearchResultItem.Episode.Ids.TvRage.Should().Be(1065008299U); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_Episode_ReadObject_From_Stream_Not_Valid_3() { var jsonReader = new SearchResultObjectJsonReader(); using (var stream = TYPE_EPISODE_JSON_NOT_VALID_3.ToStream()) { var traktSearchResultItem = await jsonReader.ReadObjectAsync(stream); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Episode); traktSearchResultItem.Score.Should().Be(46.29501f); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.Show.Should().NotBeNull(); traktSearchResultItem.Show.Title.Should().Be("Game of Thrones"); traktSearchResultItem.Show.Year.Should().Be(2011); traktSearchResultItem.Show.Ids.Should().NotBeNull(); traktSearchResultItem.Show.Ids.Trakt.Should().Be(1390U); traktSearchResultItem.Show.Ids.Slug.Should().Be("game-of-thrones"); traktSearchResultItem.Show.Ids.Tvdb.Should().Be(121361U); traktSearchResultItem.Show.Ids.Imdb.Should().Be("tt0944947"); traktSearchResultItem.Show.Ids.Tmdb.Should().Be(1399U); traktSearchResultItem.Show.Ids.TvRage.Should().Be(24493U); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_Movie_ReadObject_From_JsonReader_Incomplete_1() { var traktJsonReader = new SearchResultObjectJsonReader(); using (var reader = new StringReader(TYPE_MOVIE_JSON_INCOMPLETE_1)) using (var jsonReader = new JsonTextReader(reader)) { var traktSearchResultItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().BeNull(); traktSearchResultItem.Score.Should().Be(46.29501f); traktSearchResultItem.Movie.Should().NotBeNull(); traktSearchResultItem.Movie.Title.Should().Be("Star Wars: The Force Awakens"); traktSearchResultItem.Movie.Year.Should().Be(2015); traktSearchResultItem.Movie.Ids.Should().NotBeNull(); traktSearchResultItem.Movie.Ids.Trakt.Should().Be(94024U); traktSearchResultItem.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); traktSearchResultItem.Movie.Ids.Imdb.Should().Be("tt2488496"); traktSearchResultItem.Movie.Ids.Tmdb.Should().Be(140607U); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_Show_ReadObject_From_Json_String_Incomplete_2() { var jsonReader = new SearchResultObjectJsonReader(); var traktSearchResultItem = await jsonReader.ReadObjectAsync(TYPE_SHOW_JSON_INCOMPLETE_2); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Show); traktSearchResultItem.Score.Should().BeNull(); traktSearchResultItem.Show.Should().NotBeNull(); traktSearchResultItem.Show.Title.Should().Be("Game of Thrones"); traktSearchResultItem.Show.Year.Should().Be(2011); traktSearchResultItem.Show.Ids.Should().NotBeNull(); traktSearchResultItem.Show.Ids.Trakt.Should().Be(1390U); traktSearchResultItem.Show.Ids.Slug.Should().Be("game-of-thrones"); traktSearchResultItem.Show.Ids.Tvdb.Should().Be(121361U); traktSearchResultItem.Show.Ids.Imdb.Should().Be("tt0944947"); traktSearchResultItem.Show.Ids.Tmdb.Should().Be(1399U); traktSearchResultItem.Show.Ids.TvRage.Should().Be(24493U); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); }
public async Task Test_SearchResultObjectJsonReader_Person_ReadObject_From_JsonReader_Incomplete_2() { var traktJsonReader = new SearchResultObjectJsonReader(); using (var reader = new StringReader(TYPE_PERSON_JSON_INCOMPLETE_2)) using (var jsonReader = new JsonTextReader(reader)) { var traktSearchResultItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Person); traktSearchResultItem.Score.Should().BeNull(); traktSearchResultItem.Person.Should().NotBeNull(); traktSearchResultItem.Person.Name.Should().Be("Bryan Cranston"); traktSearchResultItem.Person.Ids.Should().NotBeNull(); traktSearchResultItem.Person.Ids.Trakt.Should().Be(297737U); traktSearchResultItem.Person.Ids.Slug.Should().Be("bryan-cranston"); traktSearchResultItem.Person.Ids.Imdb.Should().Be("nm0186505"); traktSearchResultItem.Person.Ids.Tmdb.Should().Be(17419U); traktSearchResultItem.Person.Ids.TvRage.Should().Be(1797U); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); } }
public void Test_SearchResultObjectJsonReader_ReadObject_From_JsonReader_Null() { var traktJsonReader = new SearchResultObjectJsonReader(); Func <Task <ITraktSearchResult> > traktSearchResultItem = () => traktJsonReader.ReadObjectAsync(default(JsonTextReader)); traktSearchResultItem.Should().Throw <ArgumentNullException>(); }
public async Task Test_SearchResultObjectJsonReader_Person_ReadObject_From_Stream_Incomplete_1() { var jsonReader = new SearchResultObjectJsonReader(); using (var stream = TYPE_PERSON_JSON_INCOMPLETE_1.ToStream()) { var traktSearchResultItem = await jsonReader.ReadObjectAsync(stream); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().BeNull(); traktSearchResultItem.Score.Should().Be(46.29501f); traktSearchResultItem.Person.Should().NotBeNull(); traktSearchResultItem.Person.Name.Should().Be("Bryan Cranston"); traktSearchResultItem.Person.Ids.Should().NotBeNull(); traktSearchResultItem.Person.Ids.Trakt.Should().Be(297737U); traktSearchResultItem.Person.Ids.Slug.Should().Be("bryan-cranston"); traktSearchResultItem.Person.Ids.Imdb.Should().Be("nm0186505"); traktSearchResultItem.Person.Ids.Tmdb.Should().Be(17419U); traktSearchResultItem.Person.Ids.TvRage.Should().Be(1797U); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_Episode_ReadObject_From_JsonReader_Incomplete_7() { var traktJsonReader = new SearchResultObjectJsonReader(); using (var reader = new StringReader(TYPE_EPISODE_JSON_INCOMPLETE_7)) using (var jsonReader = new JsonTextReader(reader)) { var traktSearchResultItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().BeNull(); traktSearchResultItem.Score.Should().BeNull(); traktSearchResultItem.Episode.Should().NotBeNull(); traktSearchResultItem.Episode.SeasonNumber.Should().Be(1); traktSearchResultItem.Episode.Number.Should().Be(1); traktSearchResultItem.Episode.Title.Should().Be("Winter Is Coming"); traktSearchResultItem.Episode.Ids.Should().NotBeNull(); traktSearchResultItem.Episode.Ids.Trakt.Should().Be(73640U); traktSearchResultItem.Episode.Ids.Tvdb.Should().Be(3254641U); traktSearchResultItem.Episode.Ids.Imdb.Should().Be("tt1480055"); traktSearchResultItem.Episode.Ids.Tmdb.Should().Be(63056U); traktSearchResultItem.Episode.Ids.TvRage.Should().Be(1065008299U); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_ReadObject_From_Json_String_Empty() { var jsonReader = new SearchResultObjectJsonReader(); var traktSearchResultItem = await jsonReader.ReadObjectAsync(string.Empty); traktSearchResultItem.Should().BeNull(); }
public async Task Test_SearchResultObjectJsonReader_ReadObject_From_Stream_Null() { var jsonReader = new SearchResultObjectJsonReader(); var traktSearchResultItem = await jsonReader.ReadObjectAsync(default(Stream)); traktSearchResultItem.Should().BeNull(); }
public async Task Test_SearchResultObjectJsonReader_ReadObject_From_JsonReader_Null() { var traktJsonReader = new SearchResultObjectJsonReader(); var traktSearchResultItem = await traktJsonReader.ReadObjectAsync(default(JsonTextReader)); traktSearchResultItem.Should().BeNull(); }
public async Task Test_SearchResultObjectJsonReader_ReadObject_From_Stream_Empty() { var jsonReader = new SearchResultObjectJsonReader(); using (var stream = string.Empty.ToStream()) { var traktSearchResultItem = await jsonReader.ReadObjectAsync(stream); traktSearchResultItem.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_ReadObject_From_JsonReader_Empty() { var traktJsonReader = new SearchResultObjectJsonReader(); using (var reader = new StringReader(string.Empty)) using (var jsonReader = new JsonTextReader(reader)) { var traktSearchResultItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktSearchResultItem.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_Movie_ReadObject_From_Json_String_Not_Valid_4() { var jsonReader = new SearchResultObjectJsonReader(); var traktSearchResultItem = await jsonReader.ReadObjectAsync(TYPE_MOVIE_JSON_NOT_VALID_4); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().BeNull(); traktSearchResultItem.Score.Should().BeNull(); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); }
public async Task Test_SearchResultObjectJsonReader_Person_ReadObject_From_Json_String_Not_Valid_3() { var jsonReader = new SearchResultObjectJsonReader(); var traktSearchResultItem = await jsonReader.ReadObjectAsync(TYPE_PERSON_JSON_NOT_VALID_3); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Person); traktSearchResultItem.Score.Should().Be(46.29501f); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); }
public async Task Test_SearchResultObjectJsonReader_Movie_ReadObject_From_Json_String_Incomplete_3() { var jsonReader = new SearchResultObjectJsonReader(); var traktSearchResultItem = await jsonReader.ReadObjectAsync(TYPE_MOVIE_JSON_INCOMPLETE_3); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Movie); traktSearchResultItem.Score.Should().Be(46.29501f); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); }
public async Task Test_SearchResultObjectJsonReader_Episode_ReadObject_From_Stream_Not_Valid_5() { var jsonReader = new SearchResultObjectJsonReader(); using (var stream = TYPE_EPISODE_JSON_NOT_VALID_5.ToStream()) { var traktSearchResultItem = await jsonReader.ReadObjectAsync(stream); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().BeNull(); traktSearchResultItem.Score.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_List_ReadObject_From_JsonReader_Incomplete_1() { var traktJsonReader = new SearchResultObjectJsonReader(); using (var reader = new StringReader(TYPE_LIST_JSON_INCOMPLETE_1)) using (var jsonReader = new JsonTextReader(reader)) { var traktSearchResultItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().BeNull(); traktSearchResultItem.Score.Should().Be(46.29501f); traktSearchResultItem.List.Should().NotBeNull(); traktSearchResultItem.List.Name.Should().Be("Star Wars in machete order"); traktSearchResultItem.List.Description.Should().Be("Next time you want to introduce someone to Star Wars for the first time, watch the films with them in this order: IV, V, II, III, VI."); traktSearchResultItem.List.Privacy.Should().Be(TraktAccessScope.Public); traktSearchResultItem.List.DisplayNumbers.Should().BeTrue(); traktSearchResultItem.List.AllowComments.Should().BeFalse(); traktSearchResultItem.List.SortBy.Should().Be("rank"); traktSearchResultItem.List.SortHow.Should().Be("asc"); traktSearchResultItem.List.CreatedAt.Should().Be(DateTime.Parse("2014-10-11T17:00:54.000Z").ToUniversalTime()); traktSearchResultItem.List.UpdatedAt.Should().Be(DateTime.Parse("2014-11-09T17:00:54.000Z").ToUniversalTime()); traktSearchResultItem.List.ItemCount.Should().Be(5); traktSearchResultItem.List.CommentCount.Should().Be(1); traktSearchResultItem.List.Likes.Should().Be(2); traktSearchResultItem.List.Ids.Should().NotBeNull(); traktSearchResultItem.List.Ids.Trakt.Should().Be(55); traktSearchResultItem.List.Ids.Slug.Should().Be("star-wars-in-machete-order"); traktSearchResultItem.List.User.Should().NotBeNull(); traktSearchResultItem.List.User.Username.Should().Be("sean"); traktSearchResultItem.List.User.IsPrivate.Should().BeFalse(); traktSearchResultItem.List.User.Name.Should().Be("Sean Rudford"); traktSearchResultItem.List.User.IsVIP.Should().BeTrue(); traktSearchResultItem.List.User.IsVIP_EP.Should().BeFalse(); traktSearchResultItem.List.User.Ids.Should().NotBeNull(); traktSearchResultItem.List.User.Ids.Slug.Should().Be("sean"); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_Episode_ReadObject_From_Stream_Incomplete_6() { var jsonReader = new SearchResultObjectJsonReader(); using (var stream = TYPE_EPISODE_JSON_INCOMPLETE_6.ToStream()) { var traktSearchResultItem = await jsonReader.ReadObjectAsync(stream); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().BeNull(); traktSearchResultItem.Score.Should().Be(46.29501f); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_Episode_ReadObject_From_JsonReader_Not_Valid_5() { var traktJsonReader = new SearchResultObjectJsonReader(); using (var reader = new StringReader(TYPE_EPISODE_JSON_NOT_VALID_5)) using (var jsonReader = new JsonTextReader(reader)) { var traktSearchResultItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().BeNull(); traktSearchResultItem.Score.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_Episode_ReadObject_From_JsonReader_Incomplete_6() { var traktJsonReader = new SearchResultObjectJsonReader(); using (var reader = new StringReader(TYPE_EPISODE_JSON_INCOMPLETE_6)) using (var jsonReader = new JsonTextReader(reader)) { var traktSearchResultItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().BeNull(); traktSearchResultItem.Score.Should().Be(46.29501f); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); } }
public async Task Test_TraktSearchResult_With_Type_Movie_From_Json() { var jsonReader = new SearchResultObjectJsonReader(); var traktSearchResultItem = await jsonReader.ReadObjectAsync(TYPE_MOVIE_JSON) as TraktSearchResult; traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Movie); traktSearchResultItem.Score.Should().Be(46.29501f); traktSearchResultItem.Movie.Should().NotBeNull(); traktSearchResultItem.Movie.Title.Should().Be("Star Wars: The Force Awakens"); traktSearchResultItem.Movie.Year.Should().Be(2015); traktSearchResultItem.Movie.Ids.Should().NotBeNull(); traktSearchResultItem.Movie.Ids.Trakt.Should().Be(94024U); traktSearchResultItem.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); traktSearchResultItem.Movie.Ids.Imdb.Should().Be("tt2488496"); traktSearchResultItem.Movie.Ids.Tmdb.Should().Be(140607U); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); }
public async Task Test_TraktSearchResult_With_Type_Person_From_Json() { var jsonReader = new SearchResultObjectJsonReader(); var traktSearchResultItem = await jsonReader.ReadObjectAsync(TYPE_PERSON_JSON) as TraktSearchResult; traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Person); traktSearchResultItem.Score.Should().Be(46.29501f); traktSearchResultItem.Person.Should().NotBeNull(); traktSearchResultItem.Person.Name.Should().Be("Bryan Cranston"); traktSearchResultItem.Person.Ids.Should().NotBeNull(); traktSearchResultItem.Person.Ids.Trakt.Should().Be(297737U); traktSearchResultItem.Person.Ids.Slug.Should().Be("bryan-cranston"); traktSearchResultItem.Person.Ids.Imdb.Should().Be("nm0186505"); traktSearchResultItem.Person.Ids.Tmdb.Should().Be(17419U); traktSearchResultItem.Person.Ids.TvRage.Should().Be(1797U); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); }
public async Task Test_SearchResultObjectJsonReader_Episode_ReadObject_From_JsonReader_Not_Valid_2() { var traktJsonReader = new SearchResultObjectJsonReader(); using (var reader = new StringReader(TYPE_EPISODE_JSON_NOT_VALID_2)) using (var jsonReader = new JsonTextReader(reader)) { var traktSearchResultItem = await traktJsonReader.ReadObjectAsync(jsonReader); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Episode); traktSearchResultItem.Score.Should().BeNull(); traktSearchResultItem.Episode.Should().NotBeNull(); traktSearchResultItem.Episode.SeasonNumber.Should().Be(1); traktSearchResultItem.Episode.Number.Should().Be(1); traktSearchResultItem.Episode.Title.Should().Be("Winter Is Coming"); traktSearchResultItem.Episode.Ids.Should().NotBeNull(); traktSearchResultItem.Episode.Ids.Trakt.Should().Be(73640U); traktSearchResultItem.Episode.Ids.Tvdb.Should().Be(3254641U); traktSearchResultItem.Episode.Ids.Imdb.Should().Be("tt1480055"); traktSearchResultItem.Episode.Ids.Tmdb.Should().Be(63056U); traktSearchResultItem.Episode.Ids.TvRage.Should().Be(1065008299U); traktSearchResultItem.Show.Should().NotBeNull(); traktSearchResultItem.Show.Title.Should().Be("Game of Thrones"); traktSearchResultItem.Show.Year.Should().Be(2011); traktSearchResultItem.Show.Ids.Should().NotBeNull(); traktSearchResultItem.Show.Ids.Trakt.Should().Be(1390U); traktSearchResultItem.Show.Ids.Slug.Should().Be("game-of-thrones"); traktSearchResultItem.Show.Ids.Tvdb.Should().Be(121361U); traktSearchResultItem.Show.Ids.Imdb.Should().Be("tt0944947"); traktSearchResultItem.Show.Ids.Tmdb.Should().Be(1399U); traktSearchResultItem.Show.Ids.TvRage.Should().Be(24493U); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_Person_ReadObject_From_Json_String_Not_Valid_2() { var jsonReader = new SearchResultObjectJsonReader(); var traktSearchResultItem = await jsonReader.ReadObjectAsync(TYPE_PERSON_JSON_NOT_VALID_2); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Person); traktSearchResultItem.Score.Should().BeNull(); traktSearchResultItem.Person.Should().NotBeNull(); traktSearchResultItem.Person.Name.Should().Be("Bryan Cranston"); traktSearchResultItem.Person.Ids.Should().NotBeNull(); traktSearchResultItem.Person.Ids.Trakt.Should().Be(297737U); traktSearchResultItem.Person.Ids.Slug.Should().Be("bryan-cranston"); traktSearchResultItem.Person.Ids.Imdb.Should().Be("nm0186505"); traktSearchResultItem.Person.Ids.Tmdb.Should().Be(17419U); traktSearchResultItem.Person.Ids.TvRage.Should().Be(1797U); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); }
public async Task Test_SearchResultObjectJsonReader_Episode_ReadObject_From_Stream_Incomplete_2() { var jsonReader = new SearchResultObjectJsonReader(); using (var stream = TYPE_EPISODE_JSON_INCOMPLETE_2.ToStream()) { var traktSearchResultItem = await jsonReader.ReadObjectAsync(stream); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.Episode); traktSearchResultItem.Score.Should().BeNull(); traktSearchResultItem.Episode.Should().NotBeNull(); traktSearchResultItem.Episode.SeasonNumber.Should().Be(1); traktSearchResultItem.Episode.Number.Should().Be(1); traktSearchResultItem.Episode.Title.Should().Be("Winter Is Coming"); traktSearchResultItem.Episode.Ids.Should().NotBeNull(); traktSearchResultItem.Episode.Ids.Trakt.Should().Be(73640U); traktSearchResultItem.Episode.Ids.Tvdb.Should().Be(3254641U); traktSearchResultItem.Episode.Ids.Imdb.Should().Be("tt1480055"); traktSearchResultItem.Episode.Ids.Tmdb.Should().Be(63056U); traktSearchResultItem.Episode.Ids.TvRage.Should().Be(1065008299U); traktSearchResultItem.Show.Should().NotBeNull(); traktSearchResultItem.Show.Title.Should().Be("Game of Thrones"); traktSearchResultItem.Show.Year.Should().Be(2011); traktSearchResultItem.Show.Ids.Should().NotBeNull(); traktSearchResultItem.Show.Ids.Trakt.Should().Be(1390U); traktSearchResultItem.Show.Ids.Slug.Should().Be("game-of-thrones"); traktSearchResultItem.Show.Ids.Tvdb.Should().Be(121361U); traktSearchResultItem.Show.Ids.Imdb.Should().Be("tt0944947"); traktSearchResultItem.Show.Ids.Tmdb.Should().Be(1399U); traktSearchResultItem.Show.Ids.TvRage.Should().Be(24493U); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); traktSearchResultItem.List.Should().BeNull(); } }