public async Task Test_AccountSettingsObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var jsonReader = new AccountSettingsObjectJsonReader();

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

                userAccountSettings.Should().NotBeNull();
                userAccountSettings.TimeZoneId.Should().Be("America/Los_Angeles");
                userAccountSettings.Time24Hr.Should().BeNull();
                userAccountSettings.CoverImage.Should().BeNull();
                userAccountSettings.Token.Should().BeNull();
                userAccountSettings.DateFormat.Should().BeNull();
            }
        }
        public async Task Test_MostPWCShowObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var traktJsonReader = new MostPWCShowObjectJsonReader();

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

                traktMostPWCShow.Should().NotBeNull();
                traktMostPWCShow.WatcherCount.Should().Be(4992);
                traktMostPWCShow.PlayCount.Should().BeNull();
                traktMostPWCShow.CollectedCount.Should().BeNull();
                traktMostPWCShow.CollectorCount.Should().BeNull();
                traktMostPWCShow.Show.Should().BeNull();
            }
        }
        public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var jsonReader = new MovieScrobblePostResponseObjectJsonReader();

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

                movieScrobbleResponse.Should().NotBeNull();
                movieScrobbleResponse.Id.Should().Be(3373536623UL);
                movieScrobbleResponse.Action.Should().BeNull();
                movieScrobbleResponse.Progress.Should().BeNull();
                movieScrobbleResponse.Sharing.Should().BeNull();
                movieScrobbleResponse.Movie.Should().BeNull();
            }
        }
Example #4
0
        public async Task Test_SharingObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var traktJsonReader = new SharingObjectJsonReader();

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

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

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

                customListItemsPostResponseGroup.Should().NotBeNull();
                customListItemsPostResponseGroup.Movies.Should().Be(1);
                customListItemsPostResponseGroup.Shows.Should().BeNull();
                customListItemsPostResponseGroup.Seasons.Should().BeNull();
                customListItemsPostResponseGroup.Episodes.Should().BeNull();
                customListItemsPostResponseGroup.People.Should().BeNull();
            }
        }
Example #6
0
        public async Task Test_DeviceObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var objectJsonReader = new DeviceObjectJsonReader();

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

                traktDevice.Should().NotBeNull();
                traktDevice.DeviceCode.Should().Be("mockDeviceCode");
                traktDevice.UserCode.Should().BeNull();
                traktDevice.VerificationUrl.Should().BeNull();
                traktDevice.ExpiresInSeconds.Should().Be(0);
                traktDevice.IntervalInSeconds.Should().Be(0);
            }
        }
        public async Task Test_MovieReleaseObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var traktJsonReader = new MovieReleaseObjectJsonReader();

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

                traktMovieRelease.Should().NotBeNull();
                traktMovieRelease.CountryCode.Should().Be("us");
                traktMovieRelease.Certification.Should().BeNull();
                traktMovieRelease.ReleaseDate.Should().BeNull();
                traktMovieRelease.ReleaseType.Should().BeNull();
                traktMovieRelease.Note.Should().BeNull();
            }
        }
        public async Task Test_EpisodeCheckinPostResponseObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var jsonReader = new EpisodeCheckinPostResponseObjectJsonReader();

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

                checkinEpisodeResponse.Should().NotBeNull();
                checkinEpisodeResponse.Id.Should().Be(3373536620UL);
                checkinEpisodeResponse.WatchedAt.Should().BeNull();
                checkinEpisodeResponse.Sharing.Should().BeNull();
                checkinEpisodeResponse.Episode.Should().BeNull();
                checkinEpisodeResponse.Show.Should().BeNull();
            }
        }
        public async Task Test_EpisodeIdsObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var traktJsonReader = new EpisodeIdsObjectJsonReader();

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

                traktEpisodeIds.Should().NotBeNull();
                traktEpisodeIds.Trakt.Should().Be(73640);
                traktEpisodeIds.Tvdb.Should().BeNull();
                traktEpisodeIds.Imdb.Should().BeNull();
                traktEpisodeIds.Tmdb.Should().BeNull();
                traktEpisodeIds.TvRage.Should().BeNull();
            }
        }
Example #10
0
        public async Task Test_ShowIdsObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var traktJsonReader = new ShowIdsObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_6.ToStream())
            {
                var traktShowIds = await traktJsonReader.ReadObjectAsync(stream);

                traktShowIds.Should().NotBeNull();
                traktShowIds.Trakt.Should().Be(1390);
                traktShowIds.Slug.Should().Be("game-of-thrones");
                traktShowIds.Tvdb.Should().Be(121361U);
                traktShowIds.Imdb.Should().Be("tt0944947");
                traktShowIds.Tmdb.Should().Be(1399U);
                traktShowIds.TvRage.Should().BeNull();
            }
        }
        public async Task Test_UserMoviesStatisticsObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var jsonReader = new UserMoviesStatisticsObjectJsonReader();

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

                userMoviesStatistics.Should().NotBeNull();
                userMoviesStatistics.Plays.Should().Be(552);
                userMoviesStatistics.Watched.Should().Be(534);
                userMoviesStatistics.Minutes.Should().Be(17330);
                userMoviesStatistics.Collected.Should().Be(117);
                userMoviesStatistics.Ratings.Should().Be(64);
                userMoviesStatistics.Comments.Should().BeNull();
            }
        }
        public async Task Test_MetadataObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var traktJsonReader = new MetadataObjectJsonReader();

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

                traktMetadata.Should().NotBeNull();
                traktMetadata.MediaType.Should().Be(TraktMediaType.Digital);
                traktMetadata.MediaResolution.Should().Be(TraktMediaResolution.HD_720p);
                traktMetadata.Audio.Should().Be(TraktMediaAudio.AAC);
                traktMetadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_5_1);
                traktMetadata.HDR.Should().Be(TraktMediaHDR.DolbyVision);
                traktMetadata.ThreeDimensional.Should().BeNull();
            }
        }
Example #13
0
        public async Task Test_SyncEpisodesLastActivitiesObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var jsonReader = new SyncEpisodesLastActivitiesObjectJsonReader();

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

                episodesLastActivities.Should().NotBeNull();
                episodesLastActivities.WatchedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.305Z").ToUniversalTime());
                episodesLastActivities.CollectedAt.Should().Be(DateTime.Parse("2014-11-19T22:02:41.308Z").ToUniversalTime());
                episodesLastActivities.RatedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.310Z").ToUniversalTime());
                episodesLastActivities.WatchlistedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.321Z").ToUniversalTime());
                episodesLastActivities.CommentedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.325Z").ToUniversalTime());
                episodesLastActivities.PausedAt.Should().BeNull();
            }
        }
Example #14
0
        public async Task Test_StatisticsObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var traktJsonReader = new StatisticsObjectJsonReader();

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

                traktStatistics.Should().NotBeNull();
                traktStatistics.Watchers.Should().Be(129920);
                traktStatistics.Plays.Should().Be(3563853);
                traktStatistics.Collectors.Should().Be(49711);
                traktStatistics.CollectedEpisodes.Should().Be(1310350);
                traktStatistics.Comments.Should().Be(96);
                traktStatistics.Lists.Should().BeNull();
                traktStatistics.Votes.Should().Be(9274);
            }
        }
Example #15
0
        public async Task Test_CollectionShowEpisodeArrayJsonReader_ReadArray_From_Stream_Incomplete_6()
        {
            var jsonReader = new CollectionShowEpisodeArrayJsonReader();

            using (var stream = JSON_INCOMPLETE_6.ToStream())
            {
                var traktCollectionShowEpisodes = await jsonReader.ReadArrayAsync(stream);

                traktCollectionShowEpisodes.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(3);

                var collectionShowEpisodes = traktCollectionShowEpisodes.ToArray();

                collectionShowEpisodes[0].Should().NotBeNull();
                collectionShowEpisodes[0].Number.Should().Be(1);
                collectionShowEpisodes[0].CollectedAt.Should().Be(DateTime.Parse("2014-07-14T01:00:00.000Z").ToUniversalTime());
                collectionShowEpisodes[0].Metadata.Should().NotBeNull();
                collectionShowEpisodes[0].Metadata.MediaType.Should().Be(TraktMediaType.Digital);
                collectionShowEpisodes[0].Metadata.MediaResolution.Should().Be(TraktMediaResolution.HD_720p);
                collectionShowEpisodes[0].Metadata.Audio.Should().Be(TraktMediaAudio.AAC);
                collectionShowEpisodes[0].Metadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_5_1);
                collectionShowEpisodes[0].Metadata.ThreeDimensional.Should().BeTrue();

                collectionShowEpisodes[1].Should().NotBeNull();
                collectionShowEpisodes[1].Number.Should().Be(2);
                collectionShowEpisodes[1].CollectedAt.Should().Be(DateTime.Parse("2014-07-15T01:00:00.000Z").ToUniversalTime());
                collectionShowEpisodes[1].Metadata.Should().NotBeNull();
                collectionShowEpisodes[1].Metadata.MediaType.Should().Be(TraktMediaType.Digital);
                collectionShowEpisodes[1].Metadata.MediaResolution.Should().Be(TraktMediaResolution.HD_720p);
                collectionShowEpisodes[1].Metadata.Audio.Should().Be(TraktMediaAudio.AAC);
                collectionShowEpisodes[1].Metadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_5_1);
                collectionShowEpisodes[1].Metadata.ThreeDimensional.Should().BeFalse();

                collectionShowEpisodes[2].Should().NotBeNull();
                collectionShowEpisodes[2].Number.Should().BeNull();
                collectionShowEpisodes[2].CollectedAt.Should().BeNull();
                collectionShowEpisodes[2].Metadata.Should().NotBeNull();
                collectionShowEpisodes[2].Metadata.MediaType.Should().Be(TraktMediaType.Digital);
                collectionShowEpisodes[2].Metadata.MediaResolution.Should().Be(TraktMediaResolution.HD_720p);
                collectionShowEpisodes[2].Metadata.Audio.Should().Be(TraktMediaAudio.AAC);
                collectionShowEpisodes[2].Metadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_5_1);
                collectionShowEpisodes[2].Metadata.ThreeDimensional.Should().BeTrue();
            }
        }
Example #16
0
        public async Task Test_CollectionShowEpisodeObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var jsonReader = new CollectionShowEpisodeObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_6.ToStream())
            {
                var traktCollectionShowEpisode = await jsonReader.ReadObjectAsync(stream);

                traktCollectionShowEpisode.Should().NotBeNull();
                traktCollectionShowEpisode.Number.Should().BeNull();
                traktCollectionShowEpisode.CollectedAt.Should().BeNull();
                traktCollectionShowEpisode.Metadata.Should().NotBeNull();
                traktCollectionShowEpisode.Metadata.MediaType.Should().Be(TraktMediaType.Digital);
                traktCollectionShowEpisode.Metadata.MediaResolution.Should().Be(TraktMediaResolution.HD_720p);
                traktCollectionShowEpisode.Metadata.Audio.Should().Be(TraktMediaAudio.AAC);
                traktCollectionShowEpisode.Metadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_5_1);
                traktCollectionShowEpisode.Metadata.ThreeDimensional.Should().BeTrue();
            }
        }
Example #17
0
        public async Task Test_CollectionMovieObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var jsonReader = new CollectionMovieObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_6.ToStream())
            {
                var traktCollectionMovie = await jsonReader.ReadObjectAsync(stream);

                traktCollectionMovie.Should().NotBeNull();
                traktCollectionMovie.CollectedAt.Should().BeNull();
                traktCollectionMovie.Movie.Should().BeNull();

                traktCollectionMovie.Metadata.Should().NotBeNull();
                traktCollectionMovie.Metadata.MediaType.Should().Be(TraktMediaType.Bluray);
                traktCollectionMovie.Metadata.MediaResolution.Should().Be(TraktMediaResolution.HD_1080p);
                traktCollectionMovie.Metadata.Audio.Should().Be(TraktMediaAudio.DTS);
                traktCollectionMovie.Metadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_6_1);
                traktCollectionMovie.Metadata.ThreeDimensional.Should().BeFalse();
            }
        }
Example #18
0
        public async Task Test_AuthorizationObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var objectJsonReader = new AuthorizationObjectJsonReader
            {
                CompleteDeserialization = true
            };

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

                traktAuthorization.Should().NotBeNull();
                traktAuthorization.AccessToken.Should().Be("mockAccessToken");
                traktAuthorization.RefreshToken.Should().Be("mockRefreshToken");
                traktAuthorization.Scope.Should().Be(TraktAccessScope.Public);
                traktAuthorization.ExpiresInSeconds.Should().Be(7200U);
                traktAuthorization.TokenType.Should().Be(TraktAccessTokenType.Bearer);
                traktAuthorization.CreatedAtTimestamp.Should().Be(0);
                traktAuthorization.IgnoreExpiration.Should().BeTrue();
            }
        }
Example #19
0
        public async Task Test_CertificationArrayJsonReader_ReadArray_From_Stream_Incomplete_6()
        {
            var traktJsonReader = new CertificationArrayJsonReader();

            using (var stream = JSON_INCOMPLETE_6.ToStream())
            {
                var traktCertifications = await traktJsonReader.ReadArrayAsync(stream);

                traktCertifications.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);
                var items = traktCertifications.ToArray();

                items[0].Should().NotBeNull();
                items[0].Name.Should().Be("PG");
                items[0].Slug.Should().Be("pg");
                items[0].Description.Should().Be("Parental Guidance Suggested");

                items[1].Should().NotBeNull();
                items[1].Name.Should().BeNull();
                items[1].Slug.Should().BeNull();
                items[1].Description.Should().Be("Parents Strongly Cautioned - Ages 13+ Recommended");
            }
        }
        public async Task Test_UserSettingsObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var jsonReader = new UserSettingsObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_6.ToStream())
            {
                var userSettings = await jsonReader.ReadObjectAsync(stream);

                userSettings.Should().NotBeNull();

                userSettings.User.Should().BeNull();

                userSettings.Account.Should().NotBeNull();
                userSettings.Account.TimeZoneId.Should().Be("America/Los_Angeles");
                userSettings.Account.Time24Hr.Should().BeTrue();
                userSettings.Account.CoverImage.Should().Be("https://walter.trakt.us/images/movies/000/001/545/fanarts/original/0abb604492.jpg?1406095042");
                userSettings.Account.Token.Should().Be("60fa34c4f5e7f093ecc5a2d16d691e24");

                userSettings.Connections.Should().BeNull();
                userSettings.SharingText.Should().BeNull();
            }
        }
        public async Task Test_WatchedMovieObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var jsonReader = new WatchedMovieObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_6.ToStream())
            {
                var traktWatchedMovie = await jsonReader.ReadObjectAsync(stream);

                traktWatchedMovie.Should().NotBeNull();
                traktWatchedMovie.Plays.Should().BeNull();
                traktWatchedMovie.LastWatchedAt.Should().BeNull();

                traktWatchedMovie.Movie.Should().NotBeNull();
                traktWatchedMovie.Movie.Title.Should().Be("Star Wars: The Force Awakens");
                traktWatchedMovie.Movie.Year.Should().Be(2015);
                traktWatchedMovie.Movie.Ids.Should().NotBeNull();
                traktWatchedMovie.Movie.Ids.Trakt.Should().Be(94024U);
                traktWatchedMovie.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015");
                traktWatchedMovie.Movie.Ids.Imdb.Should().Be("tt2488496");
                traktWatchedMovie.Movie.Ids.Tmdb.Should().Be(140607U);
            }
        }
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var jsonReader = new CalendarShowObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_6.ToStream())
            {
                var traktCalendarShow = await jsonReader.ReadObjectAsync(stream);

                traktCalendarShow.Should().NotBeNull();
                traktCalendarShow.FirstAiredInCalendar.Should().BeNull();
                traktCalendarShow.Show.Should().BeNull();

                traktCalendarShow.Episode.Should().NotBeNull();
                traktCalendarShow.Episode.SeasonNumber.Should().Be(1);
                traktCalendarShow.Episode.Number.Should().Be(1);
                traktCalendarShow.Episode.Title.Should().Be("Winter Is Coming");
                traktCalendarShow.Episode.Ids.Should().NotBeNull();
                traktCalendarShow.Episode.Ids.Trakt.Should().Be(73640U);
                traktCalendarShow.Episode.Ids.Tvdb.Should().Be(3254641U);
                traktCalendarShow.Episode.Ids.Imdb.Should().Be("tt1480055");
                traktCalendarShow.Episode.Ids.Tmdb.Should().Be(63056U);
                traktCalendarShow.Episode.Ids.TvRage.Should().Be(1065008299U);
            }
        }
        public async Task Test_UserCustomListItemsPostResponseObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var jsonReader = new UserCustomListItemsPostResponseObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_6.ToStream())
            {
                var customListItemsPostResponse = await jsonReader.ReadObjectAsync(stream);

                customListItemsPostResponse.Should().NotBeNull();

                customListItemsPostResponse.Added.Should().BeNull();
                customListItemsPostResponse.Existing.Should().BeNull();

                customListItemsPostResponse.NotFound.Should().NotBeNull();

                var notFound = customListItemsPostResponse.NotFound;
                notFound.Movies.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);

                var movies = notFound.Movies.ToArray();

                movies[0].Should().NotBeNull();
                movies[0].Ids.Should().NotBeNull();
                movies[0].Ids.Trakt.Should().Be(94024U);
                movies[0].Ids.Slug.Should().Be("star-wars-the-force-awakens-2015");
                movies[0].Ids.Imdb.Should().Be("tt2488496");
                movies[0].Ids.Tmdb.Should().Be(140607U);

                movies[1].Should().NotBeNull();
                movies[1].Ids.Should().NotBeNull();
                movies[1].Ids.Trakt.Should().Be(172687U);
                movies[1].Ids.Slug.Should().Be("king-arthur-legend-of-the-sword-2017");
                movies[1].Ids.Imdb.Should().Be("tt1972591");
                movies[1].Ids.Tmdb.Should().Be(274857U);

                // --------------------------------------------------

                notFound.Shows.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);

                var shows = notFound.Shows.ToArray();

                shows[0].Should().NotBeNull();
                shows[0].Ids.Should().NotBeNull();
                shows[0].Ids.Trakt.Should().Be(1390U);
                shows[0].Ids.Slug.Should().Be("game-of-thrones");
                shows[0].Ids.Tvdb.Should().Be(121361U);
                shows[0].Ids.Imdb.Should().Be("tt0944947");
                shows[0].Ids.Tmdb.Should().Be(1399U);
                shows[0].Ids.TvRage.Should().Be(24493U);

                shows[1].Should().NotBeNull();
                shows[1].Ids.Should().NotBeNull();
                shows[1].Ids.Trakt.Should().Be(60300U);
                shows[1].Ids.Slug.Should().Be("the-flash-2014");
                shows[1].Ids.Tvdb.Should().Be(279121U);
                shows[1].Ids.Imdb.Should().Be("tt3107288");
                shows[1].Ids.Tmdb.Should().Be(60735U);
                shows[1].Ids.TvRage.Should().Be(36939U);

                // --------------------------------------------------

                notFound.Seasons.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);

                var seasons = notFound.Seasons.ToArray();

                seasons[0].Should().NotBeNull();
                seasons[0].Ids.Should().NotBeNull();
                seasons[0].Ids.Trakt.Should().Be(61430U);
                seasons[0].Ids.Tvdb.Should().Be(279121U);
                seasons[0].Ids.Tmdb.Should().Be(60523U);
                seasons[0].Ids.TvRage.Should().Be(36939U);

                seasons[1].Should().NotBeNull();
                seasons[1].Ids.Should().NotBeNull();
                seasons[1].Ids.Trakt.Should().Be(61431U);
                seasons[1].Ids.Tvdb.Should().Be(578373U);
                seasons[1].Ids.Tmdb.Should().Be(60524U);
                seasons[1].Ids.TvRage.Should().Be(36940U);

                // --------------------------------------------------

                notFound.Episodes.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);

                var episodes = notFound.Episodes.ToArray();

                episodes[0].Should().NotBeNull();
                episodes[0].Ids.Should().NotBeNull();
                episodes[0].Ids.Trakt.Should().Be(73640U);
                episodes[0].Ids.Tvdb.Should().Be(3254641U);
                episodes[0].Ids.Imdb.Should().Be("tt1480055");
                episodes[0].Ids.Tmdb.Should().Be(63056U);
                episodes[0].Ids.TvRage.Should().Be(1065008299U);

                episodes[1].Should().NotBeNull();
                episodes[1].Ids.Should().NotBeNull();
                episodes[1].Ids.Trakt.Should().Be(73641U);
                episodes[1].Ids.Tvdb.Should().Be(3436411U);
                episodes[1].Ids.Imdb.Should().Be("tt1668746");
                episodes[1].Ids.Tmdb.Should().Be(63057U);
                episodes[1].Ids.TvRage.Should().Be(1065023912U);

                // --------------------------------------------------

                notFound.People.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);

                var people = notFound.People.ToArray();

                people[0].Should().NotBeNull();
                people[0].Ids.Should().NotBeNull();
                people[0].Ids.Trakt.Should().Be(297737U);
                people[0].Ids.Slug.Should().Be("bryan-cranston");
                people[0].Ids.Imdb.Should().Be("nm0186505");
                people[0].Ids.Tmdb.Should().Be(17419U);
                people[0].Ids.TvRage.Should().Be(1797U);

                people[1].Should().NotBeNull();
                people[1].Ids.Should().NotBeNull();
                people[1].Ids.Trakt.Should().Be(9486U);
                people[1].Ids.Slug.Should().Be("samuel-l-jackson");
                people[1].Ids.Imdb.Should().Be("nm0000168");
                people[1].Ids.Tmdb.Should().Be(2231U);
                people[1].Ids.TvRage.Should().Be(55720U);
            }
        }
Example #24
0
        public async Task Test_CollectionShowObjectJsonReader_ReadObject_From_Stream_Incomplete_6()
        {
            var jsonReader = new CollectionShowObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_6.ToStream())
            {
                var traktCollectionShow = await jsonReader.ReadObjectAsync(stream);

                traktCollectionShow.Should().NotBeNull();
                traktCollectionShow.LastCollectedAt.Should().BeNull();
                traktCollectionShow.Show.Should().BeNull();

                traktCollectionShow.CollectionSeasons.Should().NotBeNull().And.HaveCount(2);
                var seasons = traktCollectionShow.CollectionSeasons.ToArray();

                // Season 1
                seasons[0].Should().NotBeNull();
                seasons[0].Number.Should().Be(1);
                seasons[0].Episodes.Should().NotBeNull();
                seasons[0].Episodes.Should().HaveCount(2);

                // Episodes of Season 1
                var episodesSeason1 = seasons[0].Episodes.ToArray();

                episodesSeason1[0].Should().NotBeNull();
                episodesSeason1[0].Number.Should().Be(1);
                episodesSeason1[0].CollectedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime());
                episodesSeason1[0].Metadata.Should().NotBeNull();
                episodesSeason1[0].Metadata.MediaType.Should().Be(TraktMediaType.Digital);
                episodesSeason1[0].Metadata.MediaResolution.Should().Be(TraktMediaResolution.HD_720p);
                episodesSeason1[0].Metadata.Audio.Should().Be(TraktMediaAudio.AAC);
                episodesSeason1[0].Metadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_5_1);
                episodesSeason1[0].Metadata.ThreeDimensional.Should().BeFalse();

                episodesSeason1[1].Should().NotBeNull();
                episodesSeason1[1].Number.Should().Be(2);
                episodesSeason1[1].CollectedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime());
                episodesSeason1[1].Metadata.Should().NotBeNull();
                episodesSeason1[1].Metadata.MediaType.Should().Be(TraktMediaType.Digital);
                episodesSeason1[1].Metadata.MediaResolution.Should().Be(TraktMediaResolution.HD_720p);
                episodesSeason1[1].Metadata.Audio.Should().Be(TraktMediaAudio.AAC);
                episodesSeason1[1].Metadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_5_1);
                episodesSeason1[1].Metadata.ThreeDimensional.Should().BeFalse();

                // Season 2
                seasons[1].Should().NotBeNull();
                seasons[1].Number.Should().Be(2);
                seasons[1].Episodes.Should().NotBeNull();
                seasons[1].Episodes.Should().HaveCount(2);

                // Episodes of Season 2
                var episodesSeason2 = seasons[1].Episodes.ToArray();

                episodesSeason2[0].Should().NotBeNull();
                episodesSeason2[0].Number.Should().Be(1);
                episodesSeason2[0].CollectedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime());
                episodesSeason1[0].Metadata.Should().NotBeNull();
                episodesSeason1[0].Metadata.MediaType.Should().Be(TraktMediaType.Digital);
                episodesSeason1[0].Metadata.MediaResolution.Should().Be(TraktMediaResolution.HD_720p);
                episodesSeason1[0].Metadata.Audio.Should().Be(TraktMediaAudio.AAC);
                episodesSeason1[0].Metadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_5_1);
                episodesSeason1[0].Metadata.ThreeDimensional.Should().BeFalse();

                episodesSeason2[1].Should().NotBeNull();
                episodesSeason2[1].Number.Should().Be(2);
                episodesSeason2[1].CollectedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime());
                episodesSeason1[1].Metadata.Should().NotBeNull();
                episodesSeason1[1].Metadata.MediaType.Should().Be(TraktMediaType.Digital);
                episodesSeason1[1].Metadata.MediaResolution.Should().Be(TraktMediaResolution.HD_720p);
                episodesSeason1[1].Metadata.Audio.Should().Be(TraktMediaAudio.AAC);
                episodesSeason1[1].Metadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_5_1);
                episodesSeason1[1].Metadata.ThreeDimensional.Should().BeFalse();
            }
        }