public async Task Test_PostResponseNotFoundShowArrayJsonReader_ReadArray_From_Stream_Not_Valid()
        {
            var jsonReader = new PostResponseNotFoundShowArrayJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var notFoundShows = await jsonReader.ReadArrayAsync(stream);

                notFoundShows.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);

                var notFoundShow = notFoundShows.ToArray();

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

                notFoundShow[1].Should().NotBeNull();
                notFoundShow[1].Ids.Should().BeNull();
            }
        }
        public async Task Test_NetworkObjectJsonReader_ReadObject_From_Stream_Not_Valid()
        {
            var traktJsonReader = new NetworkObjectJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var traktNetwork = await traktJsonReader.ReadObjectAsync(stream);

                traktNetwork.Should().NotBeNull();
                traktNetwork.Network.Should().BeNull();
            }
        }
        public async Task Test_UserImagesObjectJsonReader_ReadObject_From_Stream_Not_Valid()
        {
            var jsonReader = new UserImagesObjectJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var userImages = await jsonReader.ReadObjectAsync(stream);

                userImages.Should().NotBeNull();
                userImages.Avatar.Should().BeNull();
            }
        }
        public async Task Test_SyncCommentsLastActivitiesObjectJsonReader_ReadObject_From_Stream_Not_Valid()
        {
            var traktJsonReader = new SyncCommentsLastActivitiesObjectJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var commentsLastActivities = await traktJsonReader.ReadObjectAsync(stream);

                commentsLastActivities.Should().NotBeNull();
                commentsLastActivities.LikedAt.Should().BeNull();
            }
        }
        public async Task Test_UserCustomListsReorderPostObjectJsonReader_ReadObject_From_Stream_Not_Valid()
        {
            var traktJsonReader = new UserCustomListsReorderPostObjectJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var traktUserCustomListsReorderPost = await traktJsonReader.ReadObjectAsync(stream);

                traktUserCustomListsReorderPost.Should().NotBeNull();
                traktUserCustomListsReorderPost.Rank.Should().BeNull();
            }
        }
        public async Task Test_PostResponseNotFoundSeasonObjectJsonReader_ReadObject_From_Stream_Not_Valid()
        {
            var jsonReader = new PostResponseNotFoundSeasonObjectJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var postResponseNotFoundSeason = await jsonReader.ReadObjectAsync(stream);

                postResponseNotFoundSeason.Should().NotBeNull();
                postResponseNotFoundSeason.Ids.Should().BeNull();
            }
        }
Ejemplo n.º 7
0
        public async Task Test_CertificationsObjectStream_ReadObject_From_Stream_Not_Valid()
        {
            var traktJsonReader = new CertificationsObjectJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var traktCertifications = await traktJsonReader.ReadObjectAsync(stream);

                traktCertifications.Should().NotBeNull();
                traktCertifications.US.Should().BeNull();
            }
        }
        public async Task Test_ImageObjectJsonReader_ReadObject_From_Stream_Not_Valid()
        {
            var traktJsonReader = new ImageObjectJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var traktImage = await traktJsonReader.ReadObjectAsync(stream);

                traktImage.Should().NotBeNull();
                traktImage.Full.Should().BeNull();
            }
        }
        public async Task Test_CheckinPostErrorResponseObjectJsonReader_ReadObject_From_Stream_Not_Valid()
        {
            var jsonReader = new CheckinPostErrorResponseObjectJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var checkinErrorResponse = await jsonReader.ReadObjectAsync(stream);

                checkinErrorResponse.Should().NotBeNull();
                checkinErrorResponse.ExpiresAt.Should().BeNull();
            }
        }
        public async Task Test_NetworkArrayJsonReader_ReadArray_From_Stream_Not_Valid()
        {
            var jsonReader = new ArrayJsonReader <ITraktNetwork>();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var traktNetworks = await jsonReader.ReadArrayAsync(stream);

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

                items[0].Should().NotBeNull();
                items[0].Name.Should().Be("ABC(US)");

                items[1].Should().NotBeNull();
                items[1].Name.Should().BeNull();
            }
        }
        public async Task Test_PostResponseNotFoundSeasonArrayJsonReader_ReadArray_From_Stream_Not_Valid()
        {
            var jsonReader = new ArrayJsonReader <ITraktPostResponseNotFoundSeason>();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var notFoundSeasons = await jsonReader.ReadArrayAsync(stream);

                notFoundSeasons.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);

                var notFoundSeason = notFoundSeasons.ToArray();

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

                notFoundSeason[1].Should().NotBeNull();
                notFoundSeason[1].Ids.Should().BeNull();
            }
        }
        public async Task Test_PostResponseNotFoundMovieArrayJsonReader_ReadArray_From_Stream_Not_Valid()
        {
            var jsonReader = new ArrayJsonReader <ITraktPostResponseNotFoundMovie>();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var notFoundMovies = await jsonReader.ReadArrayAsync(stream);

                notFoundMovies.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);

                var notFoundMovie = notFoundMovies.ToArray();

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

                notFoundMovie[1].Should().NotBeNull();
                notFoundMovie[1].Ids.Should().BeNull();
            }
        }
        public async Task Test_PostResponseNotFoundEpisodeArrayJsonReader_ReadArray_From_Stream_Not_Valid()
        {
            var jsonReader = new ArrayJsonReader <ITraktPostResponseNotFoundEpisode>();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var notFoundEpisodes = await jsonReader.ReadArrayAsync(stream);

                notFoundEpisodes.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);

                var notFoundEpisode = notFoundEpisodes.ToArray();

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

                notFoundEpisode[1].Should().NotBeNull();
                notFoundEpisode[1].Ids.Should().BeNull();
            }
        }
Ejemplo n.º 14
0
        public async Task Test_PostResponseNotFoundPersonArrayJsonReader_ReadArray_From_Stream_Not_Valid()
        {
            var jsonReader = new PostResponseNotFoundPersonArrayJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var notFoundPersons = await jsonReader.ReadArrayAsync(stream);

                notFoundPersons.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2);

                var notFoundPerson = notFoundPersons.ToArray();

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

                notFoundPerson[1].Should().NotBeNull();
                notFoundPerson[1].Ids.Should().BeNull();
            }
        }