public async Task Test_UserObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var jsonReader = new UserObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var user = await jsonReader.ReadObjectAsync(stream);

                user.Should().NotBeNull();
                user.Username.Should().Be("sean");
                user.IsPrivate.Should().BeFalse();
                user.Name.Should().Be("Sean Rudford");
                user.IsVIP.Should().BeTrue();
                user.IsVIP_EP.Should().BeTrue();
                user.Ids.Should().NotBeNull();
                user.Ids.Slug.Should().Be("sean");
                user.JoinedAt.Should().HaveValue().And.Be(DateTime.Parse("2010-09-25T17:49:25.000Z").ToUniversalTime());
                user.Location.Should().Be("SF");
                user.About.Should().BeNull();
                user.Gender.Should().Be("male");
                user.Age.Should().Be(35);
                user.Images.Should().NotBeNull();
                user.Images.Avatar.Should().NotBeNull();
                user.Images.Avatar.Full.Should().Be("https://walter-dev.trakt.tv/images/users/000/000/001/avatars/large/0ba3f72910.jpg");
            }
        }
        public async Task Test_EpisodeCheckinPostResponseObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var jsonReader = new EpisodeCheckinPostResponseObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var checkinEpisodeResponse = await jsonReader.ReadObjectAsync(stream);

                checkinEpisodeResponse.Should().NotBeNull();
                checkinEpisodeResponse.Id.Should().Be(0UL);
                checkinEpisodeResponse.WatchedAt.Should().BeNull();
                checkinEpisodeResponse.Sharing.Should().BeNull();
                checkinEpisodeResponse.Episode.Should().NotBeNull();
                checkinEpisodeResponse.Episode.SeasonNumber.Should().Be(1);
                checkinEpisodeResponse.Episode.Number.Should().Be(1);
                checkinEpisodeResponse.Episode.Title.Should().Be("Winter Is Coming");
                checkinEpisodeResponse.Episode.Ids.Should().NotBeNull();
                checkinEpisodeResponse.Episode.Ids.Trakt.Should().Be(73640U);
                checkinEpisodeResponse.Episode.Ids.Tvdb.Should().Be(3254641U);
                checkinEpisodeResponse.Episode.Ids.Imdb.Should().Be("tt1480055");
                checkinEpisodeResponse.Episode.Ids.Tmdb.Should().Be(63056U);
                checkinEpisodeResponse.Episode.Ids.TvRage.Should().Be(1065008299U);
                checkinEpisodeResponse.Show.Should().BeNull();
            }
        }
        public async Task Test_SharingObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var traktJsonReader = new SharingObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var traktSharing = await traktJsonReader.ReadObjectAsync(stream);

                traktSharing.Should().NotBeNull();
                traktSharing.Twitter.Should().BeNull();
                traktSharing.Google.Should().BeNull();
                traktSharing.Tumblr.Should().BeNull();
                traktSharing.Medium.Should().BeTrue();
                traktSharing.Slack.Should().BeNull();
            }
        }
        public async Task Test_AccountSettingsObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var jsonReader = new AccountSettingsObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var userAccountSettings = await jsonReader.ReadObjectAsync(stream);

                userAccountSettings.Should().NotBeNull();
                userAccountSettings.TimeZoneId.Should().BeNull();
                userAccountSettings.Time24Hr.Should().BeNull();
                userAccountSettings.CoverImage.Should().BeNull();
                userAccountSettings.Token.Should().Be("60fa34c4f5e7f093ecc5a2d16d691e24");
                userAccountSettings.DateFormat.Should().BeNull();
            }
        }
        public async Task Test_MovieReleaseObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var traktJsonReader = new MovieReleaseObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var traktMovieRelease = await traktJsonReader.ReadObjectAsync(stream);

                traktMovieRelease.Should().NotBeNull();
                traktMovieRelease.CountryCode.Should().BeNull();
                traktMovieRelease.Certification.Should().BeNull();
                traktMovieRelease.ReleaseDate.Should().BeNull();
                traktMovieRelease.ReleaseType.Should().Be(TraktReleaseType.Premiere);
                traktMovieRelease.Note.Should().BeNull();
            }
        }
Пример #6
0
        public async Task Test_DeviceObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var objectJsonReader = new DeviceObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                ITraktDevice traktDevice = await objectJsonReader.ReadObjectAsync(stream);

                traktDevice.Should().NotBeNull();
                traktDevice.DeviceCode.Should().BeNull();
                traktDevice.UserCode.Should().BeNull();
                traktDevice.VerificationUrl.Should().BeNull();
                traktDevice.ExpiresInSeconds.Should().Be(7200U);
                traktDevice.IntervalInSeconds.Should().Be(0);
            }
        }
Пример #7
0
        public async Task Test_EpisodeIdsObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var traktJsonReader = new EpisodeIdsObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var traktEpisodeIds = await traktJsonReader.ReadObjectAsync(stream);

                traktEpisodeIds.Should().NotBeNull();
                traktEpisodeIds.Trakt.Should().Be(0);
                traktEpisodeIds.Tvdb.Should().BeNull();
                traktEpisodeIds.Imdb.Should().BeNull();
                traktEpisodeIds.Tmdb.Should().Be(63056U);
                traktEpisodeIds.TvRage.Should().BeNull();
            }
        }
        public async Task Test_MetadataObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var traktJsonReader = new MetadataObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var traktMetadata = await traktJsonReader.ReadObjectAsync(stream);

                traktMetadata.Should().NotBeNull();
                traktMetadata.MediaType.Should().BeNull();
                traktMetadata.MediaResolution.Should().BeNull();
                traktMetadata.Audio.Should().BeNull();
                traktMetadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_5_1);
                traktMetadata.ThreeDimensional.Should().BeNull();
            }
        }
        public async Task Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var jsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var customListItemsPostResponseGroup = await jsonReader.ReadObjectAsync(stream);

                customListItemsPostResponseGroup.Should().NotBeNull();
                customListItemsPostResponseGroup.Movies.Should().BeNull();
                customListItemsPostResponseGroup.Shows.Should().BeNull();
                customListItemsPostResponseGroup.Seasons.Should().BeNull();
                customListItemsPostResponseGroup.Episodes.Should().Be(4);
                customListItemsPostResponseGroup.People.Should().BeNull();
            }
        }
        public async Task Test_MostPWCShowObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var traktJsonReader = new MostPWCShowObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var traktMostPWCShow = await traktJsonReader.ReadObjectAsync(stream);

                traktMostPWCShow.Should().NotBeNull();
                traktMostPWCShow.WatcherCount.Should().BeNull();
                traktMostPWCShow.PlayCount.Should().BeNull();
                traktMostPWCShow.CollectedCount.Should().BeNull();
                traktMostPWCShow.CollectorCount.Should().Be(7964);
                traktMostPWCShow.Show.Should().BeNull();
            }
        }
Пример #11
0
        public async Task Test_SyncEpisodesLastActivitiesObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var jsonReader = new SyncEpisodesLastActivitiesObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var episodesLastActivities = await jsonReader.ReadObjectAsync(stream);

                episodesLastActivities.Should().NotBeNull();
                episodesLastActivities.WatchedAt.Should().BeNull();
                episodesLastActivities.CollectedAt.Should().BeNull();
                episodesLastActivities.RatedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.310Z").ToUniversalTime());
                episodesLastActivities.WatchlistedAt.Should().BeNull();
                episodesLastActivities.CommentedAt.Should().BeNull();
                episodesLastActivities.PausedAt.Should().BeNull();
            }
        }
        public async Task Test_UserMoviesStatisticsObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var jsonReader = new UserMoviesStatisticsObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var userMoviesStatistics = await jsonReader.ReadObjectAsync(stream);

                userMoviesStatistics.Should().NotBeNull();
                userMoviesStatistics.Plays.Should().BeNull();
                userMoviesStatistics.Watched.Should().BeNull();
                userMoviesStatistics.Minutes.Should().Be(17330);
                userMoviesStatistics.Collected.Should().BeNull();
                userMoviesStatistics.Ratings.Should().BeNull();
                userMoviesStatistics.Comments.Should().BeNull();
            }
        }
        public async Task Test_EpisodeScrobblePostResponseObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var jsonReader = new EpisodeScrobblePostResponseObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var episodeScrobbleResponse = await jsonReader.ReadObjectAsync(stream);

                episodeScrobbleResponse.Should().NotBeNull();
                episodeScrobbleResponse.Id.Should().Be(0UL);
                episodeScrobbleResponse.Action.Should().BeNull();
                episodeScrobbleResponse.Progress.Should().Be(85.9f);
                episodeScrobbleResponse.Sharing.Should().BeNull();
                episodeScrobbleResponse.Episode.Should().BeNull();
                episodeScrobbleResponse.Show.Should().BeNull();
            }
        }
Пример #14
0
        public async Task Test_StatisticsObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var traktJsonReader = new StatisticsObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var traktStatistics = await traktJsonReader.ReadObjectAsync(stream);

                traktStatistics.Should().NotBeNull();
                traktStatistics.Watchers.Should().BeNull();
                traktStatistics.Plays.Should().Be(3563853);
                traktStatistics.Collectors.Should().BeNull();
                traktStatistics.CollectedEpisodes.Should().BeNull();
                traktStatistics.Comments.Should().BeNull();
                traktStatistics.Lists.Should().BeNull();
                traktStatistics.Votes.Should().BeNull();
            }
        }
Пример #15
0
        public async Task Test_WatchedShowObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var jsonReader = new WatchedShowObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var traktWatchedShow = await jsonReader.ReadObjectAsync(stream);

                traktWatchedShow.Should().NotBeNull();
                traktWatchedShow.Plays.Should().BeNull();
                traktWatchedShow.LastWatchedAt.Should().BeNull();
                traktWatchedShow.LastUpdatedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime());
                traktWatchedShow.ResetAt.Should().BeNull();

                traktWatchedShow.Show.Should().BeNull();

                traktWatchedShow.WatchedSeasons.Should().BeNull();
            }
        }
Пример #16
0
        public async Task Test_AuthorizationObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var objectJsonReader = new AuthorizationObjectJsonReader
            {
                CompleteDeserialization = true
            };

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                ITraktAuthorization traktAuthorization = await objectJsonReader.ReadObjectAsync(stream);

                traktAuthorization.Should().NotBeNull();
                traktAuthorization.AccessToken.Should().BeNull();
                traktAuthorization.RefreshToken.Should().Be("mockRefreshToken");
                traktAuthorization.Scope.Should().BeNull();
                traktAuthorization.ExpiresInSeconds.Should().Be(0);
                traktAuthorization.TokenType.Should().BeNull();
                traktAuthorization.CreatedAtTimestamp.Should().Be(0);
                traktAuthorization.IgnoreExpiration.Should().BeFalse();
            }
        }
        public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var jsonReader = new MovieScrobblePostResponseObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var movieScrobbleResponse = await jsonReader.ReadObjectAsync(stream);

                movieScrobbleResponse.Should().NotBeNull();
                movieScrobbleResponse.Id.Should().Be(0UL);
                movieScrobbleResponse.Action.Should().BeNull();
                movieScrobbleResponse.Progress.Should().BeNull();
                movieScrobbleResponse.Sharing.Should().NotBeNull();
                movieScrobbleResponse.Sharing.Twitter.Should().BeTrue();
                movieScrobbleResponse.Sharing.Google.Should().BeTrue();
                movieScrobbleResponse.Sharing.Tumblr.Should().BeTrue();
                movieScrobbleResponse.Sharing.Medium.Should().BeTrue();
                movieScrobbleResponse.Sharing.Slack.Should().BeTrue();
                movieScrobbleResponse.Movie.Should().BeNull();
            }
        }
        public async Task Test_UserStatisticsObjectJsonReader_ReadObject_From_Stream_Incomplete_9()
        {
            var jsonReader = new UserStatisticsObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_9.ToStream())
            {
                var userStatistics = await jsonReader.ReadObjectAsync(stream);

                userStatistics.Should().NotBeNull();

                userStatistics.Movies.Should().BeNull();
                userStatistics.Shows.Should().BeNull();

                userStatistics.Seasons.Should().NotBeNull();
                userStatistics.Seasons.Ratings.Should().Be(6);
                userStatistics.Seasons.Comments.Should().Be(1);

                userStatistics.Episodes.Should().BeNull();
                userStatistics.Network.Should().BeNull();
                userStatistics.Ratings.Should().BeNull();
            }
        }