public async Task Test_ListItemObjectJsonReader_Episode_ReadObject_From_Stream_Not_Valid_5()
        {
            var jsonReader = new ListItemObjectJsonReader();

            using (var stream = TYPE_EPISODE_JSON_NOT_VALID_5.ToStream())
            {
                var traktListItem = await jsonReader.ReadObjectAsync(stream);

                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.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().BeNull();

                traktListItem.Movie.Should().BeNull();
                traktListItem.Season.Should().BeNull();
                traktListItem.Person.Should().BeNull();
            }
        }
        public async Task Test_SyncPlaybackProgressItemObjectJsonReader_Episode_ReadObject_From_Stream_Not_Valid_5()
        {
            var jsonReader = new SyncPlaybackProgressItemObjectJsonReader();

            using (var stream = TYPE_EPISODE_JSON_NOT_VALID_5.ToStream())
            {
                var traktPlaybackProgressItem = await jsonReader.ReadObjectAsync(stream);

                traktPlaybackProgressItem.Should().NotBeNull();
                traktPlaybackProgressItem.Id.Should().Be(37U);
                traktPlaybackProgressItem.Progress.Should().Be(65.5f);
                traktPlaybackProgressItem.PausedAt.Should().Be(DateTime.Parse("2015-01-25T22:01:32.000Z").ToUniversalTime());
                traktPlaybackProgressItem.Type.Should().Be(TraktSyncType.Episode);
                traktPlaybackProgressItem.Episode.Should().BeNull();

                traktPlaybackProgressItem.Show.Should().NotBeNull();
                traktPlaybackProgressItem.Show.Title.Should().Be("Game of Thrones");
                traktPlaybackProgressItem.Show.Year.Should().Be(2011);
                traktPlaybackProgressItem.Show.Ids.Should().NotBeNull();
                traktPlaybackProgressItem.Show.Ids.Trakt.Should().Be(1390U);
                traktPlaybackProgressItem.Show.Ids.Slug.Should().Be("game-of-thrones");
                traktPlaybackProgressItem.Show.Ids.Tvdb.Should().Be(121361U);
                traktPlaybackProgressItem.Show.Ids.Imdb.Should().Be("tt0944947");
                traktPlaybackProgressItem.Show.Ids.Tmdb.Should().Be(1399U);
                traktPlaybackProgressItem.Show.Ids.TvRage.Should().Be(24493U);

                traktPlaybackProgressItem.Movie.Should().BeNull();
            }
        }
示例#3
0
        public async Task Test_HistoryItemObjectJsonReader_Episode_ReadObject_From_Stream_Not_Valid_5()
        {
            var jsonReader = new HistoryItemObjectJsonReader();

            using (var stream = TYPE_EPISODE_JSON_NOT_VALID_5.ToStream())
            {
                var traktHistoryItem = await jsonReader.ReadObjectAsync(stream);

                traktHistoryItem.Should().NotBeNull();
                traktHistoryItem.Id.Should().Be(1982347UL);
                traktHistoryItem.WatchedAt.Should().Be(DateTime.Parse("2014-02-27T09:28:53.000Z").ToUniversalTime());
                traktHistoryItem.Action.Should().Be(TraktHistoryActionType.Checkin);
                traktHistoryItem.Type.Should().Be(TraktSyncItemType.Episode);
                traktHistoryItem.Episode.Should().BeNull();
                traktHistoryItem.Show.Should().NotBeNull();
                traktHistoryItem.Show.Title.Should().Be("Game of Thrones");
                traktHistoryItem.Show.Year.Should().Be(2011);
                traktHistoryItem.Show.Ids.Should().NotBeNull();
                traktHistoryItem.Show.Ids.Trakt.Should().Be(1390U);
                traktHistoryItem.Show.Ids.Slug.Should().Be("game-of-thrones");
                traktHistoryItem.Show.Ids.Tvdb.Should().Be(121361U);
                traktHistoryItem.Show.Ids.Imdb.Should().Be("tt0944947");
                traktHistoryItem.Show.Ids.Tmdb.Should().Be(1399U);
                traktHistoryItem.Show.Ids.TvRage.Should().Be(24493U);

                traktHistoryItem.Movie.Should().BeNull();
                traktHistoryItem.Season.Should().BeNull();
            }
        }
        public async Task Test_WatchlistItemObjectJsonReader_Episode_ReadObject_From_Stream_Not_Valid_5()
        {
            var jsonReader = new WatchlistItemObjectJsonReader();

            using (var stream = TYPE_EPISODE_JSON_NOT_VALID_5.ToStream())
            {
                var traktWatchlistItem = await jsonReader.ReadObjectAsync(stream);

                traktWatchlistItem.Should().NotBeNull();
                traktWatchlistItem.ListedAt.Should().BeNull();
                traktWatchlistItem.Type.Should().BeNull();
                traktWatchlistItem.Episode.Should().BeNull();
                traktWatchlistItem.Show.Should().BeNull();
                traktWatchlistItem.Movie.Should().BeNull();
                traktWatchlistItem.Season.Should().BeNull();
            }
        }
示例#5
0
        public async Task Test_UserCommentObjectJsonReader_Episode_ReadObject_From_Stream_Not_Valid_5()
        {
            var jsonReader = new UserCommentObjectJsonReader();

            using (var stream = TYPE_EPISODE_JSON_NOT_VALID_5.ToStream())
            {
                var traktUserComment = await jsonReader.ReadObjectAsync(stream);

                traktUserComment.Should().NotBeNull();
                traktUserComment.Type.Should().BeNull();
                traktUserComment.Comment.Should().BeNull();
                traktUserComment.Episode.Should().BeNull();
                traktUserComment.Show.Should().BeNull();
                traktUserComment.Movie.Should().BeNull();
                traktUserComment.Season.Should().BeNull();
                traktUserComment.List.Should().BeNull();
            }
        }