public async Task Test_RecommendationObjectJsonReader_Show_ReadObject_From_JsonReader_Not_Valid_2() { var traktJsonReader = new RecommendationObjectJsonReader(); using var reader = new StringReader(JSON_SHOW_NOT_VALID_2); using var jsonReader = new JsonTextReader(reader); ITraktRecommendation traktRecommendation = await traktJsonReader.ReadObjectAsync(jsonReader); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().Be(1); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().Be(TraktRecommendationObjectType.Show); traktRecommendation.Notes.Should().Be("Atmospheric for days."); traktRecommendation.Show.Should().NotBeNull(); traktRecommendation.Show.Title.Should().Be("The Walking Dead"); traktRecommendation.Show.Year.Should().Be(2010); traktRecommendation.Show.Ids.Should().NotBeNull(); traktRecommendation.Show.Ids.Trakt.Should().Be(2U); traktRecommendation.Show.Ids.Slug.Should().Be("the-walking-dead"); traktRecommendation.Show.Ids.Tvdb.Should().Be(153021U); traktRecommendation.Show.Ids.Imdb.Should().Be("tt1520211"); traktRecommendation.Show.Ids.Tmdb.Should().Be(1402U); traktRecommendation.Movie.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_ReadObject_From_Json_String_Empty() { var jsonReader = new RecommendationObjectJsonReader(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(string.Empty); traktRecommendation.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Show_ReadObject_From_JsonReader_Incomplete_3() { var traktJsonReader = new RecommendationObjectJsonReader(); using var reader = new StringReader(JSON_SHOW_INCOMPLETE_3); using var jsonReader = new JsonTextReader(reader); ITraktRecommendation traktRecommendation = await traktJsonReader.ReadObjectAsync(jsonReader); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().Be(1); traktRecommendation.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktRecommendation.Type.Should().BeNull(); traktRecommendation.Notes.Should().Be("Atmospheric for days."); traktRecommendation.Show.Should().NotBeNull(); traktRecommendation.Show.Title.Should().Be("The Walking Dead"); traktRecommendation.Show.Year.Should().Be(2010); traktRecommendation.Show.Ids.Should().NotBeNull(); traktRecommendation.Show.Ids.Trakt.Should().Be(2U); traktRecommendation.Show.Ids.Slug.Should().Be("the-walking-dead"); traktRecommendation.Show.Ids.Tvdb.Should().Be(153021U); traktRecommendation.Show.Ids.Imdb.Should().Be("tt1520211"); traktRecommendation.Show.Ids.Tmdb.Should().Be(1402U); traktRecommendation.Movie.Should().BeNull(); }
public void Test_RecommendationObjectJsonReader_ReadObject_From_JsonReader_Null() { var traktJsonReader = new RecommendationObjectJsonReader(); Func <Task <ITraktRecommendation> > traktRecommendation = () => traktJsonReader.ReadObjectAsync(default(JsonTextReader)); traktRecommendation.Should().Throw <ArgumentNullException>(); }
public async Task Test_RecommendationObjectJsonReader_Show_ReadObject_From_JsonReader_Incomplete_10() { var traktJsonReader = new RecommendationObjectJsonReader(); using var reader = new StringReader(JSON_SHOW_INCOMPLETE_10); using var jsonReader = new JsonTextReader(reader); ITraktRecommendation traktRecommendation = await traktJsonReader.ReadObjectAsync(jsonReader); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().BeNull(); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().BeNull(); traktRecommendation.Notes.Should().BeNull(); traktRecommendation.Show.Should().NotBeNull(); traktRecommendation.Show.Title.Should().Be("The Walking Dead"); traktRecommendation.Show.Year.Should().Be(2010); traktRecommendation.Show.Ids.Should().NotBeNull(); traktRecommendation.Show.Ids.Trakt.Should().Be(2U); traktRecommendation.Show.Ids.Slug.Should().Be("the-walking-dead"); traktRecommendation.Show.Ids.Tvdb.Should().Be(153021U); traktRecommendation.Show.Ids.Imdb.Should().Be("tt1520211"); traktRecommendation.Show.Ids.Tmdb.Should().Be(1402U); traktRecommendation.Movie.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_ReadObject_From_JsonReader_Empty() { var traktJsonReader = new RecommendationObjectJsonReader(); using var reader = new StringReader(string.Empty); using var jsonReader = new JsonTextReader(reader); ITraktRecommendation traktRecommendation = await traktJsonReader.ReadObjectAsync(jsonReader); traktRecommendation.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Show_ReadObject_From_Json_String_Incomplete_7() { var jsonReader = new RecommendationObjectJsonReader(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(JSON_SHOW_INCOMPLETE_7); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().BeNull(); traktRecommendation.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktRecommendation.Type.Should().BeNull(); traktRecommendation.Notes.Should().BeNull(); traktRecommendation.Show.Should().BeNull(); traktRecommendation.Movie.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Movie_ReadObject_From_Json_String_Incomplete_9() { var jsonReader = new RecommendationObjectJsonReader(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(JSON_MOVIE_INCOMPLETE_9); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().BeNull(); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().BeNull(); traktRecommendation.Notes.Should().Be("Daft Punk really knocks it out of the park on the soundtrack."); traktRecommendation.Movie.Should().BeNull(); traktRecommendation.Show.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Show_ReadObject_From_Json_String_Not_Valid_5() { var jsonReader = new RecommendationObjectJsonReader(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(JSON_SHOW_NOT_VALID_5); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().Be(1); traktRecommendation.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktRecommendation.Type.Should().Be(TraktRecommendationObjectType.Show); traktRecommendation.Notes.Should().Be("Atmospheric for days."); traktRecommendation.Show.Should().BeNull(); traktRecommendation.Movie.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Show_ReadObject_From_Json_String_Not_Valid_6() { var jsonReader = new RecommendationObjectJsonReader(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(JSON_SHOW_NOT_VALID_6); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().BeNull(); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().BeNull(); traktRecommendation.Notes.Should().BeNull(); traktRecommendation.Show.Should().BeNull(); traktRecommendation.Movie.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Movie_ReadObject_From_Json_String_Not_Valid_5() { var jsonReader = new RecommendationObjectJsonReader(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(JSON_MOVIE_NOT_VALID_5); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().Be(1); traktRecommendation.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktRecommendation.Type.Should().Be(TraktRecommendationObjectType.Movie); traktRecommendation.Notes.Should().Be("Daft Punk really knocks it out of the park on the soundtrack."); traktRecommendation.Movie.Should().BeNull(); traktRecommendation.Show.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Show_ReadObject_From_Json_String_Incomplete_9() { var jsonReader = new RecommendationObjectJsonReader(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(JSON_SHOW_INCOMPLETE_9); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().BeNull(); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().BeNull(); traktRecommendation.Notes.Should().Be("Atmospheric for days."); traktRecommendation.Show.Should().BeNull(); traktRecommendation.Movie.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Movie_ReadObject_From_Json_String_Incomplete_8() { var jsonReader = new RecommendationObjectJsonReader(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(JSON_MOVIE_INCOMPLETE_8); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().BeNull(); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().Be(TraktRecommendationObjectType.Movie); traktRecommendation.Notes.Should().BeNull(); traktRecommendation.Movie.Should().BeNull(); traktRecommendation.Show.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Movie_ReadObject_From_Stream_Not_Valid_6() { var jsonReader = new RecommendationObjectJsonReader(); using var stream = JSON_MOVIE_NOT_VALID_6.ToStream(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(stream); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().BeNull(); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().BeNull(); traktRecommendation.Notes.Should().BeNull(); traktRecommendation.Movie.Should().BeNull(); traktRecommendation.Show.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Movie_ReadObject_From_Stream_Incomplete_5() { var jsonReader = new RecommendationObjectJsonReader(); using var stream = JSON_MOVIE_INCOMPLETE_5.ToStream(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(stream); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().Be(1); traktRecommendation.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktRecommendation.Type.Should().Be(TraktRecommendationObjectType.Movie); traktRecommendation.Notes.Should().Be("Daft Punk really knocks it out of the park on the soundtrack."); traktRecommendation.Movie.Should().BeNull(); traktRecommendation.Show.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Show_ReadObject_From_Stream_Incomplete_8() { var jsonReader = new RecommendationObjectJsonReader(); using var stream = JSON_SHOW_INCOMPLETE_8.ToStream(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(stream); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().BeNull(); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().Be(TraktRecommendationObjectType.Show); traktRecommendation.Notes.Should().BeNull(); traktRecommendation.Show.Should().BeNull(); traktRecommendation.Movie.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Show_ReadObject_From_Stream_Incomplete_5() { var jsonReader = new RecommendationObjectJsonReader(); using var stream = JSON_SHOW_INCOMPLETE_5.ToStream(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(stream); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().Be(1); traktRecommendation.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktRecommendation.Type.Should().Be(TraktRecommendationObjectType.Show); traktRecommendation.Notes.Should().Be("Atmospheric for days."); traktRecommendation.Show.Should().BeNull(); traktRecommendation.Movie.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Movie_ReadObject_From_JsonReader_Not_Valid_6() { var traktJsonReader = new RecommendationObjectJsonReader(); using var reader = new StringReader(JSON_MOVIE_NOT_VALID_6); using var jsonReader = new JsonTextReader(reader); ITraktRecommendation traktRecommendation = await traktJsonReader.ReadObjectAsync(jsonReader); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().BeNull(); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().BeNull(); traktRecommendation.Notes.Should().BeNull(); traktRecommendation.Movie.Should().BeNull(); traktRecommendation.Show.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Show_ReadObject_From_JsonReader_Incomplete_8() { var traktJsonReader = new RecommendationObjectJsonReader(); using var reader = new StringReader(JSON_SHOW_INCOMPLETE_8); using var jsonReader = new JsonTextReader(reader); ITraktRecommendation traktRecommendation = await traktJsonReader.ReadObjectAsync(jsonReader); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().BeNull(); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().Be(TraktRecommendationObjectType.Show); traktRecommendation.Notes.Should().BeNull(); traktRecommendation.Show.Should().BeNull(); traktRecommendation.Movie.Should().BeNull(); }
public async Task Test_TraktRecommendation_From_Json_With_Movie() { var jsonReader = new RecommendationObjectJsonReader(); var recommendation = await jsonReader.ReadObjectAsync(JSON_MOVIE) as TraktRecommendation; recommendation.Should().NotBeNull(); recommendation.Rank.Should().Be(1); recommendation.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); recommendation.Type.Should().Be(TraktRecommendationObjectType.Movie); recommendation.Notes.Should().Be("Daft Punk really knocks it out of the park on the soundtrack."); recommendation.Movie.Should().NotBeNull(); recommendation.Movie.Title.Should().Be("TRON: Legacy"); recommendation.Movie.Year.Should().Be(2010); recommendation.Movie.Ids.Should().NotBeNull(); recommendation.Movie.Ids.Trakt.Should().Be(1U); recommendation.Movie.Ids.Slug.Should().Be("tron-legacy-2010"); recommendation.Movie.Ids.Imdb.Should().Be("tt1104001"); recommendation.Movie.Ids.Tmdb.Should().Be(20526U); recommendation.Show.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Movie_ReadObject_From_Json_String_Not_Valid_4() { var jsonReader = new RecommendationObjectJsonReader(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(JSON_MOVIE_NOT_VALID_4); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().Be(1); traktRecommendation.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktRecommendation.Type.Should().Be(TraktRecommendationObjectType.Movie); traktRecommendation.Notes.Should().BeNull(); traktRecommendation.Movie.Should().NotBeNull(); traktRecommendation.Movie.Title.Should().Be("TRON: Legacy"); traktRecommendation.Movie.Year.Should().Be(2010); traktRecommendation.Movie.Ids.Should().NotBeNull(); traktRecommendation.Movie.Ids.Trakt.Should().Be(1U); traktRecommendation.Movie.Ids.Slug.Should().Be("tron-legacy-2010"); traktRecommendation.Movie.Ids.Imdb.Should().Be("tt1104001"); traktRecommendation.Movie.Ids.Tmdb.Should().Be(20526U); traktRecommendation.Show.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Movie_ReadObject_From_Json_String_Incomplete_2() { var jsonReader = new RecommendationObjectJsonReader(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(JSON_MOVIE_INCOMPLETE_2); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().Be(1); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().Be(TraktRecommendationObjectType.Movie); traktRecommendation.Notes.Should().Be("Daft Punk really knocks it out of the park on the soundtrack."); traktRecommendation.Movie.Should().NotBeNull(); traktRecommendation.Movie.Title.Should().Be("TRON: Legacy"); traktRecommendation.Movie.Year.Should().Be(2010); traktRecommendation.Movie.Ids.Should().NotBeNull(); traktRecommendation.Movie.Ids.Trakt.Should().Be(1U); traktRecommendation.Movie.Ids.Slug.Should().Be("tron-legacy-2010"); traktRecommendation.Movie.Ids.Imdb.Should().Be("tt1104001"); traktRecommendation.Movie.Ids.Tmdb.Should().Be(20526U); traktRecommendation.Show.Should().BeNull(); }
public async Task Test_TraktRecommendation_From_Json_With_Show() { var jsonReader = new RecommendationObjectJsonReader(); var recommendation = await jsonReader.ReadObjectAsync(JSON_SHOW) as TraktRecommendation; recommendation.Should().NotBeNull(); recommendation.Rank.Should().Be(1); recommendation.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); recommendation.Type.Should().Be(TraktRecommendationObjectType.Show); recommendation.Notes.Should().Be("Atmospheric for days."); recommendation.Movie.Should().BeNull(); recommendation.Show.Should().NotBeNull(); recommendation.Show.Title.Should().Be("The Walking Dead"); recommendation.Show.Year.Should().Be(2010); recommendation.Show.Ids.Should().NotBeNull(); recommendation.Show.Ids.Trakt.Should().Be(2U); recommendation.Show.Ids.Slug.Should().Be("the-walking-dead"); recommendation.Show.Ids.Tvdb.Should().Be(153021U); recommendation.Show.Ids.Imdb.Should().Be("tt1520211"); recommendation.Show.Ids.Tmdb.Should().Be(1402U); }
public async Task Test_RecommendationObjectJsonReader_Show_ReadObject_From_Json_String_Incomplete_2() { var jsonReader = new RecommendationObjectJsonReader(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(JSON_SHOW_INCOMPLETE_2); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().Be(1); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().Be(TraktRecommendationObjectType.Show); traktRecommendation.Notes.Should().Be("Atmospheric for days."); traktRecommendation.Show.Should().NotBeNull(); traktRecommendation.Show.Title.Should().Be("The Walking Dead"); traktRecommendation.Show.Year.Should().Be(2010); traktRecommendation.Show.Ids.Should().NotBeNull(); traktRecommendation.Show.Ids.Trakt.Should().Be(2U); traktRecommendation.Show.Ids.Slug.Should().Be("the-walking-dead"); traktRecommendation.Show.Ids.Tvdb.Should().Be(153021U); traktRecommendation.Show.Ids.Imdb.Should().Be("tt1520211"); traktRecommendation.Show.Ids.Tmdb.Should().Be(1402U); traktRecommendation.Movie.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Show_ReadObject_From_Json_String_Not_Valid_4() { var jsonReader = new RecommendationObjectJsonReader(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(JSON_SHOW_NOT_VALID_4); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().Be(1); traktRecommendation.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktRecommendation.Type.Should().Be(TraktRecommendationObjectType.Show); traktRecommendation.Notes.Should().BeNull(); traktRecommendation.Show.Should().NotBeNull(); traktRecommendation.Show.Title.Should().Be("The Walking Dead"); traktRecommendation.Show.Year.Should().Be(2010); traktRecommendation.Show.Ids.Should().NotBeNull(); traktRecommendation.Show.Ids.Trakt.Should().Be(2U); traktRecommendation.Show.Ids.Slug.Should().Be("the-walking-dead"); traktRecommendation.Show.Ids.Tvdb.Should().Be(153021U); traktRecommendation.Show.Ids.Imdb.Should().Be("tt1520211"); traktRecommendation.Show.Ids.Tmdb.Should().Be(1402U); traktRecommendation.Movie.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Movie_ReadObject_From_Stream_Incomplete_3() { var jsonReader = new RecommendationObjectJsonReader(); using var stream = JSON_MOVIE_INCOMPLETE_3.ToStream(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(stream); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().Be(1); traktRecommendation.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktRecommendation.Type.Should().BeNull(); traktRecommendation.Notes.Should().Be("Daft Punk really knocks it out of the park on the soundtrack."); traktRecommendation.Movie.Should().NotBeNull(); traktRecommendation.Movie.Title.Should().Be("TRON: Legacy"); traktRecommendation.Movie.Year.Should().Be(2010); traktRecommendation.Movie.Ids.Should().NotBeNull(); traktRecommendation.Movie.Ids.Trakt.Should().Be(1U); traktRecommendation.Movie.Ids.Slug.Should().Be("tron-legacy-2010"); traktRecommendation.Movie.Ids.Imdb.Should().Be("tt1104001"); traktRecommendation.Movie.Ids.Tmdb.Should().Be(20526U); traktRecommendation.Show.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Movie_ReadObject_From_Stream_Incomplete_10() { var jsonReader = new RecommendationObjectJsonReader(); using var stream = JSON_MOVIE_INCOMPLETE_10.ToStream(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(stream); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().BeNull(); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().BeNull(); traktRecommendation.Notes.Should().BeNull(); traktRecommendation.Movie.Should().NotBeNull(); traktRecommendation.Movie.Title.Should().Be("TRON: Legacy"); traktRecommendation.Movie.Year.Should().Be(2010); traktRecommendation.Movie.Ids.Should().NotBeNull(); traktRecommendation.Movie.Ids.Trakt.Should().Be(1U); traktRecommendation.Movie.Ids.Slug.Should().Be("tron-legacy-2010"); traktRecommendation.Movie.Ids.Imdb.Should().Be("tt1104001"); traktRecommendation.Movie.Ids.Tmdb.Should().Be(20526U); traktRecommendation.Show.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Movie_ReadObject_From_Stream_Not_Valid_2() { var jsonReader = new RecommendationObjectJsonReader(); using var stream = JSON_MOVIE_NOT_VALID_2.ToStream(); ITraktRecommendation traktRecommendation = await jsonReader.ReadObjectAsync(stream); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().Be(1); traktRecommendation.ListedAt.Should().BeNull(); traktRecommendation.Type.Should().Be(TraktRecommendationObjectType.Movie); traktRecommendation.Notes.Should().Be("Daft Punk really knocks it out of the park on the soundtrack."); traktRecommendation.Movie.Should().NotBeNull(); traktRecommendation.Movie.Title.Should().Be("TRON: Legacy"); traktRecommendation.Movie.Year.Should().Be(2010); traktRecommendation.Movie.Ids.Should().NotBeNull(); traktRecommendation.Movie.Ids.Trakt.Should().Be(1U); traktRecommendation.Movie.Ids.Slug.Should().Be("tron-legacy-2010"); traktRecommendation.Movie.Ids.Imdb.Should().Be("tt1104001"); traktRecommendation.Movie.Ids.Tmdb.Should().Be(20526U); traktRecommendation.Show.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_Movie_ReadObject_From_JsonReader_Not_Valid_3() { var traktJsonReader = new RecommendationObjectJsonReader(); using var reader = new StringReader(JSON_MOVIE_NOT_VALID_3); using var jsonReader = new JsonTextReader(reader); ITraktRecommendation traktRecommendation = await traktJsonReader.ReadObjectAsync(jsonReader); traktRecommendation.Should().NotBeNull(); traktRecommendation.Rank.Should().Be(1); traktRecommendation.ListedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktRecommendation.Type.Should().BeNull(); traktRecommendation.Notes.Should().Be("Daft Punk really knocks it out of the park on the soundtrack."); traktRecommendation.Movie.Should().NotBeNull(); traktRecommendation.Movie.Title.Should().Be("TRON: Legacy"); traktRecommendation.Movie.Year.Should().Be(2010); traktRecommendation.Movie.Ids.Should().NotBeNull(); traktRecommendation.Movie.Ids.Trakt.Should().Be(1U); traktRecommendation.Movie.Ids.Slug.Should().Be("tron-legacy-2010"); traktRecommendation.Movie.Ids.Imdb.Should().Be("tt1104001"); traktRecommendation.Movie.Ids.Tmdb.Should().Be(20526U); traktRecommendation.Show.Should().BeNull(); }
public async Task Test_RecommendationObjectJsonReader_ReadObject_From_Json_String_Null() { var jsonReader = new RecommendationObjectJsonReader(); Func <Task <ITraktRecommendation> > traktRecommendation = () => jsonReader.ReadObjectAsync(default(string)); await traktRecommendation.Should().ThrowAsync <ArgumentNullException>(); }