Esempio n. 1
0
        public async Task Test_EpisodeTranslationArrayJsonReader_ReadArray_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new ArrayJsonReader <ITraktEpisodeTranslation>();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktEpisodeTranslations = await traktJsonReader.ReadArrayAsync(stream);

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

                var translations = traktEpisodeTranslations.ToArray();

                translations[0].Title.Should().BeNull();
                translations[0].Overview.Should().Be("Translation Overview 1");
                translations[0].LanguageCode.Should().Be("Translation Language 1");

                translations[1].Title.Should().Be("Translation 2");
                translations[1].Overview.Should().BeNull();
                translations[1].LanguageCode.Should().Be("Translation Language 2");

                translations[2].Title.Should().Be("Translation 3");
                translations[2].Overview.Should().Be("Translation Overview 3");
                translations[2].LanguageCode.Should().BeNull();
            }
        }
        public async Task Test_EpisodeScrobblePostResponseObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new EpisodeScrobblePostResponseObjectJsonReader();

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

                episodeScrobbleResponse.Should().NotBeNull();
                episodeScrobbleResponse.Id.Should().Be(3373536623UL);
                episodeScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Stop);
                episodeScrobbleResponse.Progress.Should().Be(85.9f);
                episodeScrobbleResponse.Sharing.Should().BeNull();
                episodeScrobbleResponse.Episode.Should().NotBeNull();
                episodeScrobbleResponse.Episode.SeasonNumber.Should().Be(1);
                episodeScrobbleResponse.Episode.Number.Should().Be(1);
                episodeScrobbleResponse.Episode.Title.Should().Be("Winter Is Coming");
                episodeScrobbleResponse.Episode.Ids.Should().NotBeNull();
                episodeScrobbleResponse.Episode.Ids.Trakt.Should().Be(73640U);
                episodeScrobbleResponse.Episode.Ids.Tvdb.Should().Be(3254641U);
                episodeScrobbleResponse.Episode.Ids.Imdb.Should().Be("tt1480055");
                episodeScrobbleResponse.Episode.Ids.Tmdb.Should().Be(63056U);
                episodeScrobbleResponse.Episode.Ids.TvRage.Should().Be(1065008299U);
                episodeScrobbleResponse.Show.Should().NotBeNull();
                episodeScrobbleResponse.Show.Title.Should().Be("Game of Thrones");
                episodeScrobbleResponse.Show.Year.Should().Be(2011);
                episodeScrobbleResponse.Show.Ids.Should().NotBeNull();
                episodeScrobbleResponse.Show.Ids.Trakt.Should().Be(1390U);
                episodeScrobbleResponse.Show.Ids.Slug.Should().Be("game-of-thrones");
                episodeScrobbleResponse.Show.Ids.Tvdb.Should().Be(121361U);
                episodeScrobbleResponse.Show.Ids.Imdb.Should().Be("tt0944947");
                episodeScrobbleResponse.Show.Ids.Tmdb.Should().Be(1399U);
                episodeScrobbleResponse.Show.Ids.TvRage.Should().Be(24493U);
            }
        }
        public async Task Test_EpisodeCheckinPostResponseObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new EpisodeCheckinPostResponseObjectJsonReader();

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

                checkinEpisodeResponse.Should().NotBeNull();
                checkinEpisodeResponse.Id.Should().Be(3373536620UL);
                checkinEpisodeResponse.WatchedAt.Should().Be(DateTime.Parse("2014-08-06T06:54:36.859Z").ToUniversalTime());
                checkinEpisodeResponse.Sharing.Should().NotBeNull();
                checkinEpisodeResponse.Sharing.Facebook.Should().BeTrue();
                checkinEpisodeResponse.Sharing.Twitter.Should().BeTrue();
                checkinEpisodeResponse.Sharing.Google.Should().BeTrue();
                checkinEpisodeResponse.Sharing.Tumblr.Should().BeTrue();
                checkinEpisodeResponse.Sharing.Medium.Should().BeTrue();
                checkinEpisodeResponse.Sharing.Slack.Should().BeTrue();
                checkinEpisodeResponse.Episode.Should().BeNull();
                checkinEpisodeResponse.Show.Should().NotBeNull();
                checkinEpisodeResponse.Show.Title.Should().Be("Game of Thrones");
                checkinEpisodeResponse.Show.Year.Should().Be(2011);
                checkinEpisodeResponse.Show.Ids.Should().NotBeNull();
                checkinEpisodeResponse.Show.Ids.Trakt.Should().Be(1390U);
                checkinEpisodeResponse.Show.Ids.Slug.Should().Be("game-of-thrones");
                checkinEpisodeResponse.Show.Ids.Tvdb.Should().Be(121361U);
                checkinEpisodeResponse.Show.Ids.Imdb.Should().Be("tt0944947");
                checkinEpisodeResponse.Show.Ids.Tmdb.Should().Be(1399U);
                checkinEpisodeResponse.Show.Ids.TvRage.Should().Be(24493U);
            }
        }
Esempio n. 4
0
        public async Task Test_EpisodeCollectionProgressArrayJsonReader_ReadArray_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new ArrayJsonReader <ITraktEpisodeCollectionProgress>();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktEpisodeCollectionProgresses = await traktJsonReader.ReadArrayAsync(stream);

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

                var collectionProgress = traktEpisodeCollectionProgresses.ToArray();

                collectionProgress[0].Number.Should().BeNull();
                collectionProgress[0].Completed.Should().BeTrue();
                collectionProgress[0].CollectedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime());

                collectionProgress[1].Number.Should().Be(2);
                collectionProgress[1].Completed.Should().BeNull();
                collectionProgress[1].CollectedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime());

                collectionProgress[2].Number.Should().Be(3);
                collectionProgress[2].Completed.Should().BeTrue();
                collectionProgress[2].CollectedAt.Should().BeNull();
            }
        }
Esempio n. 5
0
        public async Task Test_WatchedShowObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new WatchedShowObjectJsonReader();

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

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

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

                traktWatchedShow.WatchedSeasons.Should().BeNull();
            }
        }
        public async Task Test_MostPWCShowObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new MostPWCShowObjectJsonReader();

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

                traktMostPWCShow.Should().NotBeNull();
                traktMostPWCShow.WatcherCount.Should().Be(4992);
                traktMostPWCShow.PlayCount.Should().Be(7100);
                traktMostPWCShow.CollectedCount.Should().Be(1348);
                traktMostPWCShow.CollectorCount.Should().BeNull();
                traktMostPWCShow.Show.Should().NotBeNull();
                traktMostPWCShow.Show.Title.Should().Be("Game of Thrones");
                traktMostPWCShow.Show.Year.Should().Be(2011);
                traktMostPWCShow.Show.Ids.Should().NotBeNull();
                traktMostPWCShow.Show.Ids.Trakt.Should().Be(1390U);
                traktMostPWCShow.Show.Ids.Slug.Should().Be("game-of-thrones");
                traktMostPWCShow.Show.Ids.Tvdb.Should().Be(121361U);
                traktMostPWCShow.Show.Ids.Imdb.Should().Be("tt0944947");
                traktMostPWCShow.Show.Ids.Tmdb.Should().Be(1399U);
                traktMostPWCShow.Show.Ids.TvRage.Should().Be(24493U);
            }
        }
        public async Task Test_WatchedShowEpisodeArrayJsonReader_ReadArray_From_Stream_Not_Valid_4()
        {
            var jsonReader = new ArrayJsonReader <ITraktWatchedShowEpisode>();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktWatchedShowEpisodes = await jsonReader.ReadArrayAsync(stream);

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

                var watchedShowEpisodes = traktWatchedShowEpisodes.ToArray();

                watchedShowEpisodes[0].Should().NotBeNull();
                watchedShowEpisodes[0].Number.Should().BeNull();
                watchedShowEpisodes[0].Plays.Should().Be(1);
                watchedShowEpisodes[0].LastWatchedAt.Should().Be(DateTime.Parse("2014-10-12T17:00:54.000Z").ToUniversalTime());

                watchedShowEpisodes[1].Should().NotBeNull();
                watchedShowEpisodes[1].Number.Should().Be(2);
                watchedShowEpisodes[1].Plays.Should().BeNull();
                watchedShowEpisodes[1].LastWatchedAt.Should().Be(DateTime.Parse("2014-10-12T17:00:54.000Z").ToUniversalTime());

                watchedShowEpisodes[2].Should().NotBeNull();
                watchedShowEpisodes[2].Number.Should().Be(3);
                watchedShowEpisodes[2].Plays.Should().Be(1);
                watchedShowEpisodes[2].LastWatchedAt.Should().BeNull();
            }
        }
        public async Task Test_UserObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new UserObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.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().BeNull();
                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().Be("I have all your cassette tapes.");
                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_SeasonWatchedProgressArrayJsonReader_ReadArray_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new ArrayJsonReader <ITraktSeasonWatchedProgress>();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktSeasonWatchedProgresses = await traktJsonReader.ReadArrayAsync(stream);

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

                var watchedProgresses = traktSeasonWatchedProgresses.ToArray();

                watchedProgresses[0].Number.Should().Be(1);
                watchedProgresses[0].Aired.Should().Be(3);
                watchedProgresses[0].Completed.Should().Be(2);
                watchedProgresses[0].Episodes.Should().NotBeNull().And.HaveCount(2);

                var episodesWatchedProgress = watchedProgresses[0].Episodes.ToArray();

                episodesWatchedProgress[0].Should().NotBeNull();
                episodesWatchedProgress[0].Number.Should().Be(1);
                episodesWatchedProgress[0].Completed.Should().BeTrue();
                episodesWatchedProgress[0].LastWatchedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime());

                episodesWatchedProgress[1].Should().NotBeNull();
                episodesWatchedProgress[1].Number.Should().Be(2);
                episodesWatchedProgress[1].Completed.Should().BeTrue();
                episodesWatchedProgress[1].LastWatchedAt.Should().Be(DateTime.Parse("2011-04-19T02:00:00.000Z").ToUniversalTime());

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

                watchedProgresses[1].Number.Should().Be(2);
                watchedProgresses[1].Aired.Should().Be(3);
                watchedProgresses[1].Completed.Should().Be(2);
                watchedProgresses[1].Episodes.Should().NotBeNull().And.HaveCount(2);

                episodesWatchedProgress = watchedProgresses[1].Episodes.ToArray();

                episodesWatchedProgress[0].Should().NotBeNull();
                episodesWatchedProgress[0].Number.Should().Be(1);
                episodesWatchedProgress[0].Completed.Should().BeTrue();
                episodesWatchedProgress[0].LastWatchedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime());

                episodesWatchedProgress[1].Should().NotBeNull();
                episodesWatchedProgress[1].Number.Should().Be(2);
                episodesWatchedProgress[1].Completed.Should().BeTrue();
                episodesWatchedProgress[1].LastWatchedAt.Should().Be(DateTime.Parse("2011-04-19T02:00:00.000Z").ToUniversalTime());

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

                watchedProgresses[2].Number.Should().Be(3);
                watchedProgresses[2].Aired.Should().Be(3);
                watchedProgresses[2].Completed.Should().Be(2);
                watchedProgresses[2].Episodes.Should().BeNull();
            }
        }
        public async Task Test_UserStatisticsObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new UserStatisticsObjectJsonReader();

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

                userStatistics.Should().NotBeNull();

                userStatistics.Movies.Should().NotBeNull();
                userStatistics.Movies.Plays.Should().Be(552);
                userStatistics.Movies.Watched.Should().Be(534);
                userStatistics.Movies.Minutes.Should().Be(17330);
                userStatistics.Movies.Collected.Should().Be(117);
                userStatistics.Movies.Ratings.Should().Be(64);
                userStatistics.Movies.Comments.Should().Be(14);

                userStatistics.Shows.Should().NotBeNull();
                userStatistics.Shows.Watched.Should().Be(534);
                userStatistics.Shows.Collected.Should().Be(117);
                userStatistics.Shows.Ratings.Should().Be(64);
                userStatistics.Shows.Comments.Should().Be(14);

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

                userStatistics.Episodes.Should().BeNull();

                userStatistics.Network.Should().NotBeNull();
                userStatistics.Network.Friends.Should().Be(1);
                userStatistics.Network.Followers.Should().Be(4);
                userStatistics.Network.Following.Should().Be(11);

                userStatistics.Ratings.Should().NotBeNull();
                userStatistics.Ratings.Total.Should().Be(9257);
                userStatistics.Ratings.Distribution.Should().NotBeNull();
                userStatistics.Ratings.Distribution.Should().NotBeEmpty();
                userStatistics.Ratings.Distribution.Should().HaveCount(10);
                userStatistics.Ratings.Distribution.Should().Contain(new Dictionary <string, int>
                {
                    ["1"]  = 78,
                    ["2"]  = 45,
                    ["3"]  = 55,
                    ["4"]  = 96,
                    ["5"]  = 183,
                    ["6"]  = 545,
                    ["7"]  = 1361,
                    ["8"]  = 2259,
                    ["9"]  = 1772,
                    ["10"] = 2863
                });
            }
        }
Esempio n. 11
0
        public async Task Test_UserFollowRequestObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new UserFollowRequestObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var userFollowRequest = await jsonReader.ReadObjectAsync(stream);

                userFollowRequest.Should().NotBeNull();
                userFollowRequest.Id.Should().Be(0U);
                userFollowRequest.RequestedAt.Should().BeNull();
                userFollowRequest.User.Should().BeNull();
            }
        }
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new CalendarShowObjectJsonReader();

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

                traktCalendarShow.Should().NotBeNull();
                traktCalendarShow.FirstAiredInCalendar.Should().BeNull();
                traktCalendarShow.Show.Should().BeNull();
                traktCalendarShow.Episode.Should().BeNull();
            }
        }
        public async Task Test_SyncListsLastActivitiesObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new SyncListsLastActivitiesObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var listsLastActivities = await jsonReader.ReadObjectAsync(stream);

                listsLastActivities.Should().NotBeNull();
                listsLastActivities.LikedAt.Should().BeNull();
                listsLastActivities.UpdatedAt.Should().BeNull();
                listsLastActivities.CommentedAt.Should().BeNull();
            }
        }
        public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new UserNetworkStatisticsObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var userNetworkStatistics = await jsonReader.ReadObjectAsync(stream);

                userNetworkStatistics.Should().NotBeNull();
                userNetworkStatistics.Friends.Should().BeNull();
                userNetworkStatistics.Followers.Should().BeNull();
                userNetworkStatistics.Following.Should().BeNull();
            }
        }
Esempio n. 15
0
        public async Task Test_EpisodeTranslationObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new EpisodeTranslationObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktEpisodeTranslation = await traktJsonReader.ReadObjectAsync(stream);

                traktEpisodeTranslation.Should().NotBeNull();
                traktEpisodeTranslation.Title.Should().BeNull();
                traktEpisodeTranslation.Overview.Should().BeNull();
                traktEpisodeTranslation.LanguageCode.Should().BeNull();
            }
        }
Esempio n. 16
0
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new CertificationObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktCertification = await traktJsonReader.ReadObjectAsync(stream);

                traktCertification.Should().NotBeNull();
                traktCertification.Name.Should().BeNull();
                traktCertification.Slug.Should().BeNull();
                traktCertification.Description.Should().BeNull();
            }
        }
Esempio n. 17
0
        public async Task Test_CollectionMovieObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new CollectionMovieObjectJsonReader();

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

                traktCollectionMovie.Should().NotBeNull();
                traktCollectionMovie.CollectedAt.Should().BeNull();
                traktCollectionMovie.Movie.Should().BeNull();
                traktCollectionMovie.Metadata.Should().BeNull();
            }
        }
Esempio n. 18
0
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new EpisodeWatchedProgressObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktEpisodeWatchedProgress = await traktJsonReader.ReadObjectAsync(stream);

                traktEpisodeWatchedProgress.Should().NotBeNull();
                traktEpisodeWatchedProgress.Number.Should().BeNull();
                traktEpisodeWatchedProgress.Completed.Should().BeNull();
                traktEpisodeWatchedProgress.LastWatchedAt.Should().BeNull();
            }
        }
Esempio n. 19
0
        public async Task Test_RatingObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new RatingObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktRating = await traktJsonReader.ReadObjectAsync(stream);

                traktRating.Should().NotBeNull();
                traktRating.Rating.Should().BeNull();
                traktRating.Votes.Should().BeNull();
                traktRating.Distribution.Should().BeNull();
            }
        }
Esempio n. 20
0
        public async Task Test_ShowAirsObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new ShowAirsObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktShowAirs = await traktJsonReader.ReadObjectAsync(stream);

                traktShowAirs.Should().NotBeNull();
                traktShowAirs.Day.Should().BeNull();
                traktShowAirs.Time.Should().BeNull();
                traktShowAirs.TimeZoneId.Should().BeNull();
            }
        }
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new WatchedShowEpisodeObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktWatchedShowEpisode = await jsonReader.ReadObjectAsync(stream);

                traktWatchedShowEpisode.Should().NotBeNull();
                traktWatchedShowEpisode.Number.Should().BeNull();
                traktWatchedShowEpisode.Plays.Should().BeNull();
                traktWatchedShowEpisode.LastWatchedAt.Should().BeNull();
            }
        }
        public async Task Test_SeasonIdsObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new SeasonIdsObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktSeasonIds = await traktJsonReader.ReadObjectAsync(stream);

                traktSeasonIds.Should().NotBeNull();
                traktSeasonIds.Trakt.Should().Be(61430);
                traktSeasonIds.Tvdb.Should().Be(279121U);
                traktSeasonIds.Tmdb.Should().Be(60523U);
                traktSeasonIds.TvRage.Should().BeNull();
            }
        }
        public async Task Test_MovieIdsObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new MovieIdsObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktMovieIds = await traktJsonReader.ReadObjectAsync(stream);

                traktMovieIds.Should().NotBeNull();
                traktMovieIds.Trakt.Should().Be(94024);
                traktMovieIds.Slug.Should().Be("star-wars-the-force-awakens-2015");
                traktMovieIds.Imdb.Should().Be("tt2488496");
                traktMovieIds.Tmdb.Should().BeNull();
            }
        }
        public async Task Test_UserCustomListItemsPostResponseObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new UserCustomListItemsPostResponseObjectJsonReader();

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

                customListItemsPostResponse.Should().NotBeNull();

                customListItemsPostResponse.Added.Should().BeNull();
                customListItemsPostResponse.Existing.Should().BeNull();
                customListItemsPostResponse.NotFound.Should().BeNull();
            }
        }
Esempio n. 25
0
        public async Task Test_MovieTranslationObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new MovieTranslationObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktMovieTranslation = await traktJsonReader.ReadObjectAsync(stream);

                traktMovieTranslation.Should().NotBeNull();
                traktMovieTranslation.Title.Should().Be("Star Wars: Episode VII - The Force Awakens");
                traktMovieTranslation.Overview.Should().Be("A continuation of the saga created by George Lucas, set thirty years after Star Wars: Episode VI – Return of the Jedi.");
                traktMovieTranslation.Tagline.Should().Be("The Force Lives On...");
                traktMovieTranslation.LanguageCode.Should().BeNull();
            }
        }
Esempio n. 26
0
        public async Task Test_MostPWCMovieObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new MostPWCMovieObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktMostPWCMovie = await traktJsonReader.ReadObjectAsync(stream);

                traktMostPWCMovie.Should().NotBeNull();
                traktMostPWCMovie.WatcherCount.Should().Be(4992);
                traktMostPWCMovie.PlayCount.Should().Be(7100);
                traktMostPWCMovie.CollectedCount.Should().Be(1348);
                traktMostPWCMovie.Movie.Should().BeNull();
            }
        }
Esempio n. 27
0
        public async Task Test_UserShowsStatisticsObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new UserShowsStatisticsObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var userShowsStatistics = await jsonReader.ReadObjectAsync(stream);

                userShowsStatistics.Should().NotBeNull();
                userShowsStatistics.Watched.Should().Be(534);
                userShowsStatistics.Collected.Should().Be(117);
                userShowsStatistics.Ratings.Should().Be(64);
                userShowsStatistics.Comments.Should().BeNull();
            }
        }
        public async Task Test_SyncShowsLastActivitiesObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new SyncShowsLastActivitiesObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var showsLastActivities = await jsonReader.ReadObjectAsync(stream);

                showsLastActivities.Should().NotBeNull();
                showsLastActivities.RatedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.305Z").ToUniversalTime());
                showsLastActivities.WatchlistedAt.Should().Be(DateTime.Parse("2014-11-19T22:02:41.308Z").ToUniversalTime());
                showsLastActivities.CommentedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.325Z").ToUniversalTime());
                showsLastActivities.HiddenAt.Should().BeNull();
            }
        }
Esempio n. 29
0
        public async Task Test_AccountSettingsObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new AccountSettingsObjectJsonReader();

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

                userAccountSettings.Should().NotBeNull();
                userAccountSettings.TimeZoneId.Should().Be("America/Los_Angeles");
                userAccountSettings.Time24Hr.Should().BeTrue();
                userAccountSettings.CoverImage.Should().Be("https://walter.trakt.us/images/movies/000/001/545/fanarts/original/0abb604492.jpg?1406095042");
                userAccountSettings.Token.Should().BeNull();
            }
        }
        public async Task Test_SeasonCollectionProgressObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new SeasonCollectionProgressObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktSeasonCollectionProgress = await traktJsonReader.ReadObjectAsync(stream);

                traktSeasonCollectionProgress.Should().NotBeNull();
                traktSeasonCollectionProgress.Number.Should().Be(2);
                traktSeasonCollectionProgress.Aired.Should().Be(3);
                traktSeasonCollectionProgress.Completed.Should().Be(2);
                traktSeasonCollectionProgress.Episodes.Should().BeNull();
            }
        }