public async Task Test_UserLikeItemObjectJsonReader_List_ReadObject_From_Stream_Not_Valid_3() { var jsonReader = new UserLikeItemObjectJsonReader(); using (var stream = TYPE_LIST_JSON_NOT_VALID_3.ToStream()) { var traktUserLikeItem = await jsonReader.ReadObjectAsync(stream); traktUserLikeItem.Should().NotBeNull(); traktUserLikeItem.LikedAt.Should().Be(DateTime.Parse("2015-03-30T23:18:42.000Z").ToUniversalTime()); traktUserLikeItem.Type.Should().Be(TraktUserLikeType.List); traktUserLikeItem.List.Should().BeNull(); traktUserLikeItem.Comment.Should().BeNull(); } }
public async Task Test_SearchResultObjectJsonReader_List_ReadObject_From_Stream_Not_Valid_3() { var jsonReader = new SearchResultObjectJsonReader(); using (var stream = TYPE_LIST_JSON_NOT_VALID_3.ToStream()) { var traktSearchResultItem = await jsonReader.ReadObjectAsync(stream); traktSearchResultItem.Should().NotBeNull(); traktSearchResultItem.Type.Should().Be(TraktSearchResultType.List); traktSearchResultItem.Score.Should().Be(46.29501f); traktSearchResultItem.List.Should().BeNull(); traktSearchResultItem.Movie.Should().BeNull(); traktSearchResultItem.Show.Should().BeNull(); traktSearchResultItem.Episode.Should().BeNull(); traktSearchResultItem.Person.Should().BeNull(); } }
public async Task Test_UserCommentObjectJsonReader_List_ReadObject_From_Stream_Not_Valid_3() { var jsonReader = new UserCommentObjectJsonReader(); using (var stream = TYPE_LIST_JSON_NOT_VALID_3.ToStream()) { var traktUserComment = await jsonReader.ReadObjectAsync(stream); traktUserComment.Should().NotBeNull(); traktUserComment.Type.Should().Be(TraktObjectType.List); traktUserComment.Comment.Should().NotBeNull(); traktUserComment.Comment.Id.Should().Be(76957U); traktUserComment.Comment.ParentId.Should().Be(1234U); traktUserComment.Comment.CreatedAt.Should().Be(DateTime.Parse("2016-04-01T12:44:40Z").ToUniversalTime()); traktUserComment.Comment.UpdatedAt.Should().Be(DateTime.Parse("2016-04-03T08:23:38Z").ToUniversalTime()); traktUserComment.Comment.Comment.Should().Be("I hate they made The flash a kids show. Could else be much better. And with a better flash offcourse."); traktUserComment.Comment.Spoiler.Should().BeFalse(); traktUserComment.Comment.Review.Should().BeFalse(); traktUserComment.Comment.Replies.Should().Be(1); traktUserComment.Comment.Likes.Should().Be(2); traktUserComment.Comment.UserRating.Should().Be(7.3f); traktUserComment.Comment.User.Should().NotBeNull(); traktUserComment.Comment.User.Username.Should().Be("sean"); traktUserComment.Comment.User.IsPrivate.Should().BeFalse(); traktUserComment.Comment.User.Name.Should().Be("Sean Rudford"); traktUserComment.Comment.User.IsVIP.Should().BeTrue(); traktUserComment.Comment.User.IsVIP_EP.Should().BeTrue(); traktUserComment.Comment.User.Ids.Should().NotBeNull(); traktUserComment.Comment.User.Ids.Slug.Should().Be("sean"); traktUserComment.List.Should().BeNull(); traktUserComment.Movie.Should().BeNull(); traktUserComment.Show.Should().BeNull(); traktUserComment.Season.Should().BeNull(); traktUserComment.Episode.Should().BeNull(); } }
public async Task Test_SearchResultArrayJsonReader_List_ReadArray_From_Stream_Not_Valid_3() { var jsonReader = new ArrayJsonReader <ITraktSearchResult>(); using (var stream = TYPE_LIST_JSON_NOT_VALID_3.ToStream()) { IEnumerable <ITraktSearchResult> traktSearchResults = await jsonReader.ReadArrayAsync(stream); traktSearchResults.Should().NotBeNull(); ITraktSearchResult[] searchResults = traktSearchResults.ToArray(); searchResults[0].Should().NotBeNull(); searchResults[0].Type.Should().Be(TraktSearchResultType.List); searchResults[0].Score.Should().BeNull(); searchResults[0].List.Should().NotBeNull(); searchResults[0].List.Name.Should().Be("Star Wars in machete order"); searchResults[0].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."); searchResults[0].List.Privacy.Should().Be(TraktAccessScope.Public); searchResults[0].List.DisplayNumbers.Should().BeTrue(); searchResults[0].List.AllowComments.Should().BeFalse(); searchResults[0].List.SortBy.Should().Be("rank"); searchResults[0].List.SortHow.Should().Be("asc"); searchResults[0].List.CreatedAt.Should().Be(DateTime.Parse("2014-10-11T17:00:54.000Z").ToUniversalTime()); searchResults[0].List.UpdatedAt.Should().Be(DateTime.Parse("2014-11-09T17:00:54.000Z").ToUniversalTime()); searchResults[0].List.ItemCount.Should().Be(5); searchResults[0].List.CommentCount.Should().Be(1); searchResults[0].List.Likes.Should().Be(2); searchResults[0].List.Ids.Should().NotBeNull(); searchResults[0].List.Ids.Trakt.Should().Be(55); searchResults[0].List.Ids.Slug.Should().Be("star-wars-in-machete-order"); searchResults[0].List.User.Should().NotBeNull(); searchResults[0].List.User.Username.Should().Be("sean"); searchResults[0].List.User.IsPrivate.Should().BeFalse(); searchResults[0].List.User.Name.Should().Be("Sean Rudford"); searchResults[0].List.User.IsVIP.Should().BeTrue(); searchResults[0].List.User.IsVIP_EP.Should().BeFalse(); searchResults[0].List.User.Ids.Should().NotBeNull(); searchResults[0].List.User.Ids.Slug.Should().Be("sean"); searchResults[0].Movie.Should().BeNull(); searchResults[0].Show.Should().BeNull(); searchResults[0].Episode.Should().BeNull(); searchResults[0].Person.Should().BeNull(); searchResults[1].Should().NotBeNull(); searchResults[1].Type.Should().Be(TraktSearchResultType.List); searchResults[1].Score.Should().BeNull(); searchResults[1].List.Should().NotBeNull(); searchResults[1].List.Name.Should().Be("Star Wars in machete order"); searchResults[1].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."); searchResults[1].List.Privacy.Should().Be(TraktAccessScope.Public); searchResults[1].List.DisplayNumbers.Should().BeTrue(); searchResults[1].List.AllowComments.Should().BeFalse(); searchResults[1].List.SortBy.Should().Be("rank"); searchResults[1].List.SortHow.Should().Be("asc"); searchResults[1].List.CreatedAt.Should().Be(DateTime.Parse("2014-10-11T17:00:54.000Z").ToUniversalTime()); searchResults[1].List.UpdatedAt.Should().Be(DateTime.Parse("2014-11-09T17:00:54.000Z").ToUniversalTime()); searchResults[1].List.ItemCount.Should().Be(5); searchResults[1].List.CommentCount.Should().Be(1); searchResults[1].List.Likes.Should().Be(2); searchResults[1].List.Ids.Should().NotBeNull(); searchResults[1].List.Ids.Trakt.Should().Be(55); searchResults[1].List.Ids.Slug.Should().Be("star-wars-in-machete-order"); searchResults[1].List.User.Should().NotBeNull(); searchResults[1].List.User.Username.Should().Be("sean"); searchResults[1].List.User.IsPrivate.Should().BeFalse(); searchResults[1].List.User.Name.Should().Be("Sean Rudford"); searchResults[1].List.User.IsVIP.Should().BeTrue(); searchResults[1].List.User.IsVIP_EP.Should().BeFalse(); searchResults[1].List.User.Ids.Should().NotBeNull(); searchResults[1].List.User.Ids.Slug.Should().Be("sean"); searchResults[1].Movie.Should().BeNull(); searchResults[1].Show.Should().BeNull(); searchResults[1].Episode.Should().BeNull(); searchResults[1].Person.Should().BeNull(); } }