Exemplo n.º 1
0
        public async Task Test_EpisodeTranslationArrayJsonReader_ReadArray_From_Stream_Incomplete_3()
        {
            var traktJsonReader = new ArrayJsonReader <ITraktEpisodeTranslation>();

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

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

                var translations = traktEpisodeTranslations.ToArray();

                translations[0].Title.Should().Be("Translation 1");
                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().Be("Translation Overview 2");
                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();
            }
        }
Exemplo n.º 2
0
        public async Task Test_CollectionShowObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new CollectionShowObjectJsonReader();

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

                traktCollectionShow.Should().NotBeNull();
                traktCollectionShow.LastCollectedAt.Should().Be(DateTime.Parse("2014-07-14T01:00:00.000Z").ToUniversalTime());

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

                traktCollectionShow.CollectionSeasons.Should().BeNull();
            }
        }
Exemplo n.º 3
0
        public async Task Test_EpisodeCollectionProgressArrayJsonReader_ReadArray_From_Stream_Incomplete_3()
        {
            var traktJsonReader = new ArrayJsonReader <ITraktEpisodeCollectionProgress>();

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

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

                var collectionProgress = traktEpisodeCollectionProgresses.ToArray();

                collectionProgress[0].Number.Should().Be(1);
                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().BeTrue();
                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();
            }
        }
        public async Task Test_EpisodeCheckinPostResponseObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new EpisodeCheckinPostResponseObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_3.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().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().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);
            }
        }
        public async Task Test_WatchedShowEpisodeArrayJsonReader_ReadArray_From_Stream_Incomplete_3()
        {
            var jsonReader = new ArrayJsonReader <ITraktWatchedShowEpisode>();

            using (var stream = JSON_INCOMPLETE_3.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().Be(1);
                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().Be(1);
                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_UserCustomListItemsPostResponseObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new UserCustomListItemsPostResponseObjectJsonReader();

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

                customListItemsPostResponse.Should().NotBeNull();

                customListItemsPostResponse.Added.Should().NotBeNull();
                customListItemsPostResponse.Added.Movies.Should().Be(1);
                customListItemsPostResponse.Added.Shows.Should().Be(2);
                customListItemsPostResponse.Added.Seasons.Should().Be(3);
                customListItemsPostResponse.Added.Episodes.Should().Be(4);
                customListItemsPostResponse.Added.People.Should().Be(5);

                customListItemsPostResponse.Existing.Should().NotBeNull();
                customListItemsPostResponse.Existing.Movies.Should().Be(1);
                customListItemsPostResponse.Existing.Shows.Should().Be(2);
                customListItemsPostResponse.Existing.Seasons.Should().Be(3);
                customListItemsPostResponse.Existing.Episodes.Should().Be(4);
                customListItemsPostResponse.Existing.People.Should().Be(5);

                customListItemsPostResponse.NotFound.Should().BeNull();
            }
        }
        public async Task Test_MostPWCShowObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var traktJsonReader = new MostPWCShowObjectJsonReader();

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

                traktMostPWCShow.Should().NotBeNull();
                traktMostPWCShow.WatcherCount.Should().Be(4992);
                traktMostPWCShow.PlayCount.Should().Be(7100);
                traktMostPWCShow.CollectedCount.Should().BeNull();
                traktMostPWCShow.CollectorCount.Should().Be(7964);
                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_UserObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new UserObjectJsonReader();

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

                user.Should().NotBeNull();
                user.Username.Should().Be("sean");
                user.IsPrivate.Should().BeFalse();
                user.Name.Should().BeNull();
                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().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_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new MovieScrobblePostResponseObjectJsonReader();

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

                movieScrobbleResponse.Should().NotBeNull();
                movieScrobbleResponse.Id.Should().Be(3373536623UL);
                movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Stop);
                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().NotBeNull();
                movieScrobbleResponse.Movie.Title.Should().Be("Star Wars: The Force Awakens");
                movieScrobbleResponse.Movie.Year.Should().Be(2015);
                movieScrobbleResponse.Movie.Ids.Should().NotBeNull();
                movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(94024U);
                movieScrobbleResponse.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015");
                movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2488496");
                movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(140607U);
            }
        }
        public async Task Test_SeasonWatchedProgressObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var traktJsonReader = new SeasonWatchedProgressObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_3.ToStream())
            {
                var traktSeasonWatchedProgress = await traktJsonReader.ReadObjectAsync(stream);

                traktSeasonWatchedProgress.Should().NotBeNull();
                traktSeasonWatchedProgress.Number.Should().Be(2);
                traktSeasonWatchedProgress.Aired.Should().Be(3);
                traktSeasonWatchedProgress.Completed.Should().BeNull();
                traktSeasonWatchedProgress.Episodes.Should().NotBeNull().And.HaveCount(2);

                var episodesWatchedProgress = traktSeasonWatchedProgress.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());
            }
        }
        public async Task Test_UserStatisticsObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new UserStatisticsObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_3.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().BeNull();

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

                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
                });
            }
        }
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new WatchedShowEpisodeObjectJsonReader();

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

                traktWatchedShowEpisode.Should().NotBeNull();
                traktWatchedShowEpisode.Number.Should().Be(1);
                traktWatchedShowEpisode.Plays.Should().Be(1);
                traktWatchedShowEpisode.LastWatchedAt.Should().BeNull();
            }
        }
        public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new UserNetworkStatisticsObjectJsonReader();

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

                userNetworkStatistics.Should().NotBeNull();
                userNetworkStatistics.Friends.Should().Be(1);
                userNetworkStatistics.Followers.Should().Be(4);
                userNetworkStatistics.Following.Should().BeNull();
            }
        }
        public async Task Test_SyncListsLastActivitiesObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new SyncListsLastActivitiesObjectJsonReader();

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

                listsLastActivities.Should().NotBeNull();
                listsLastActivities.LikedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.305Z").ToUniversalTime());
                listsLastActivities.UpdatedAt.Should().Be(DateTime.Parse("2014-11-19T22:02:41.308Z").ToUniversalTime());
                listsLastActivities.CommentedAt.Should().BeNull();
            }
        }
Exemplo n.º 15
0
        public async Task Test_UserFollowRequestObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new UserFollowRequestObjectJsonReader();

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

                userFollowRequest.Should().NotBeNull();
                userFollowRequest.Id.Should().Be(12345U);
                userFollowRequest.RequestedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime());
                userFollowRequest.User.Should().BeNull();
            }
        }
Exemplo n.º 16
0
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var traktJsonReader = new EpisodeWatchedProgressObjectJsonReader();

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

                traktEpisodeWatchedProgress.Should().NotBeNull();
                traktEpisodeWatchedProgress.Number.Should().Be(2);
                traktEpisodeWatchedProgress.Completed.Should().BeTrue();
                traktEpisodeWatchedProgress.LastWatchedAt.Should().BeNull();
            }
        }
        public async Task Test_WatchedMovieObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new WatchedMovieObjectJsonReader();

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

                traktWatchedMovie.Should().NotBeNull();
                traktWatchedMovie.Plays.Should().Be(1);
                traktWatchedMovie.LastWatchedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime());
                traktWatchedMovie.Movie.Should().BeNull();
            }
        }
Exemplo n.º 18
0
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var traktJsonReader = new CertificationObjectJsonReader();

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

                traktCertification.Should().NotBeNull();
                traktCertification.Name.Should().Be("PG");
                traktCertification.Slug.Should().Be("pg");
                traktCertification.Description.Should().BeNull();
            }
        }
Exemplo n.º 19
0
        public async Task Test_EpisodeTranslationObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var traktJsonReader = new EpisodeTranslationObjectJsonReader();

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

                traktEpisodeTranslation.Should().NotBeNull();
                traktEpisodeTranslation.Title.Should().Be("Winter Is Coming");
                traktEpisodeTranslation.Overview.Should().Be("Jon Arryn, the Hand of the King, is dead. King Robert Baratheon plans to ask his oldest friend, Eddard Stark, to take Jon's place. Across the sea, Viserys Targaryen plans to wed his sister to a nomadic warlord in exchange for an army.");
                traktEpisodeTranslation.LanguageCode.Should().BeNull();
            }
        }
        public async Task Test_ShowTranslationObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var traktJsonReader = new ShowTranslationObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_3.ToStream())
            {
                var traktShowTranslation = await traktJsonReader.ReadObjectAsync(stream);

                traktShowTranslation.Should().NotBeNull();
                traktShowTranslation.Title.Should().Be("Game of Thrones");
                traktShowTranslation.Overview.Should().Be("Die Handlung ist in einer fiktiven Welt angesiedelt und spielt auf den Kontinenten Westeros (den Sieben Königreichen sowie im Gebiet der „Mauer“ und jenseits davon im Norden) und Essos. In dieser Welt ist die Länge der Sommer und Winter unvorhersehbar und variabel; eine Jahreszeit kann Jahre oder sogar Jahrzehnte dauern. Der Handlungsort auf dem Kontinent Westeros in den Sieben Königreichen ähnelt dabei stark dem mittelalterlichen Europa. Die Geschichte spielt am Ende eines langen Sommers und wird in drei Handlungssträngen weitgehend parallel erzählt. In den Sieben Königreichen bauen sich zwischen den mächtigsten Adelshäusern des Reiches Spannungen auf, die schließlich zum offenen Thronkampf führen. Gleichzeitig droht der Wintereinbruch und es zeichnet sich eine Gefahr durch eine fremde Rasse im hohen Norden von Westeros ab. Der dritte Handlungsstrang spielt auf dem Kontinent Essos, wo Daenerys Targaryen, Mitglied der vor Jahren abgesetzten Königsfamilie, bestrebt ist, wieder an die Macht zu gelangen. Die komplexe Handlung umfasst zahlreiche Figuren und thematisiert unter anderem Politik und Machtkämpfe, Gesellschaftsverhältnisse und Religion.");
                traktShowTranslation.LanguageCode.Should().BeNull();
            }
        }
Exemplo n.º 21
0
        public async Task Test_RatingObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var traktJsonReader = new RatingObjectJsonReader();

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

                traktRating.Should().NotBeNull();
                traktRating.Rating.Should().Be(8.32715f);
                traktRating.Votes.Should().Be(9274);
                traktRating.Distribution.Should().BeNull();
            }
        }
Exemplo n.º 22
0
        public async Task Test_ShowAirsObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var traktJsonReader = new ShowAirsObjectJsonReader();

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

                traktShowAirs.Should().NotBeNull();
                traktShowAirs.Day.Should().Be("Sunday");
                traktShowAirs.Time.Should().Be("21:00");
                traktShowAirs.TimeZoneId.Should().BeNull();
            }
        }
Exemplo n.º 23
0
        public async Task Test_WatchedShowObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new WatchedShowObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_3.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().BeNull();

                traktWatchedShow.WatchedSeasons.Should().NotBeNull().And.HaveCount(2);
                var seasons = traktWatchedShow.WatchedSeasons.ToArray();

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

                var episodes = seasons[0].Episodes.ToArray();

                episodes[0].Should().NotBeNull();
                episodes[0].Number.Should().Be(1);
                episodes[0].Plays.Should().Be(1);
                episodes[0].LastWatchedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime());

                episodes[1].Should().NotBeNull();
                episodes[1].Number.Should().Be(2);
                episodes[1].Plays.Should().Be(1);
                episodes[1].LastWatchedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime());

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

                episodes = seasons[1].Episodes.ToArray();

                episodes[0].Should().NotBeNull();
                episodes[0].Number.Should().Be(1);
                episodes[0].Plays.Should().Be(1);
                episodes[0].LastWatchedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime());

                episodes[1].Should().NotBeNull();
                episodes[1].Number.Should().Be(2);
                episodes[1].Plays.Should().Be(1);
                episodes[1].LastWatchedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime());
            }
        }
Exemplo n.º 24
0
        public async Task Test_CollectionShowEpisodeObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new CollectionShowEpisodeObjectJsonReader();

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

                traktCollectionShowEpisode.Should().NotBeNull();
                traktCollectionShowEpisode.Number.Should().Be(1);
                traktCollectionShowEpisode.CollectedAt.Should().Be(DateTime.Parse("2014-07-14T01:00:00.000Z").ToUniversalTime());
                traktCollectionShowEpisode.Metadata.Should().BeNull();
            }
        }
        public async Task Test_MovieIdsObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var traktJsonReader = new MovieIdsObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_3.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().BeNull();
                traktMovieIds.Tmdb.Should().Be(140607U);
            }
        }
Exemplo n.º 26
0
        public async Task Test_AccountSettingsObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new AccountSettingsObjectJsonReader();

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

                userAccountSettings.Should().NotBeNull();
                userAccountSettings.TimeZoneId.Should().Be("America/Los_Angeles");
                userAccountSettings.Time24Hr.Should().BeTrue();
                userAccountSettings.CoverImage.Should().BeNull();
                userAccountSettings.Token.Should().Be("60fa34c4f5e7f093ecc5a2d16d691e24");
            }
        }
Exemplo n.º 27
0
        public async Task Test_MovieTranslationObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var traktJsonReader = new MovieTranslationObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_3.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().BeNull();
                traktMovieTranslation.LanguageCode.Should().Be("en");
            }
        }
Exemplo n.º 28
0
        public async Task Test_UserShowsStatisticsObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var jsonReader = new UserShowsStatisticsObjectJsonReader();

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

                userShowsStatistics.Should().NotBeNull();
                userShowsStatistics.Watched.Should().Be(534);
                userShowsStatistics.Collected.Should().Be(117);
                userShowsStatistics.Ratings.Should().BeNull();
                userShowsStatistics.Comments.Should().Be(14);
            }
        }
        public async Task Test_SeasonIdsObjectJsonReader_ReadObject_From_Stream_Incomplete_3()
        {
            var traktJsonReader = new SeasonIdsObjectJsonReader();

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

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

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

                traktMovieRelease.Should().NotBeNull();
                traktMovieRelease.CountryCode.Should().Be("us");
                traktMovieRelease.Certification.Should().Be("PG-13");
                traktMovieRelease.ReleaseDate.Should().BeNull();
                traktMovieRelease.ReleaseType.Should().Be(TraktReleaseType.Premiere);
                traktMovieRelease.Note.Should().Be("Los Angeles, California");
            }
        }