public async Task Test_PersonMovieCreditsCastItemArrayJsonReader_ReadObject_From_Json_String_Incomplete_1()
        {
            var jsonReader = new PersonMovieCreditsCastItemArrayJsonReader();

            var movieCreditsCastItems = await jsonReader.ReadArrayAsync(JSON_INCOMPLETE_1);

            movieCreditsCastItems.Should().NotBeNull();
            var items = movieCreditsCastItems.ToArray();

            items[0].Should().NotBeNull();
            items[0].Character.Should().BeNull();
            items[0].Movie.Should().NotBeNull();
            items[0].Movie.Title.Should().Be("Star Wars: The Force Awakens");
            items[0].Movie.Year.Should().Be(2015);
            items[0].Movie.Ids.Should().NotBeNull();
            items[0].Movie.Ids.Trakt.Should().Be(94024U);
            items[0].Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015");
            items[0].Movie.Ids.Imdb.Should().Be("tt2488496");
            items[0].Movie.Ids.Tmdb.Should().Be(140607U);

            items[1].Should().NotBeNull();
            items[1].Character.Should().Be("Sam Flynn");
            items[1].Movie.Should().NotBeNull();
            items[1].Movie.Title.Should().Be("TRON: Legacy");
            items[1].Movie.Year.Should().Be(2010);
            items[1].Movie.Ids.Should().NotBeNull();
            items[1].Movie.Ids.Trakt.Should().Be(12601U);
            items[1].Movie.Ids.Slug.Should().Be("tron-legacy-2010");
            items[1].Movie.Ids.Imdb.Should().Be("tt1104001");
            items[1].Movie.Ids.Tmdb.Should().Be(20526U);
        }
예제 #2
0
        public async Task Test_PersonMovieCreditsCastItemArrayJsonReader_ReadObject_From_JsonReader_Not_Valid_1()
        {
            var traktJsonReader = new PersonMovieCreditsCastItemArrayJsonReader();

            using (var reader = new StringReader(JSON_NOT_VALID_1))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var movieCreditsCastItems = await traktJsonReader.ReadArrayAsync(jsonReader);

                    movieCreditsCastItems.Should().NotBeNull();
                    var items = movieCreditsCastItems.ToArray();

                    items[0].Should().NotBeNull();
                    items[0].Character.Should().BeNull();
                    items[0].Movie.Should().NotBeNull();
                    items[0].Movie.Title.Should().Be("Star Wars: The Force Awakens");
                    items[0].Movie.Year.Should().Be(2015);
                    items[0].Movie.Ids.Should().NotBeNull();
                    items[0].Movie.Ids.Trakt.Should().Be(94024U);
                    items[0].Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015");
                    items[0].Movie.Ids.Imdb.Should().Be("tt2488496");
                    items[0].Movie.Ids.Tmdb.Should().Be(140607U);

                    items[1].Should().NotBeNull();
                    items[1].Character.Should().Be("Sam Flynn");
                    items[1].Movie.Should().NotBeNull();
                    items[1].Movie.Title.Should().Be("TRON: Legacy");
                    items[1].Movie.Year.Should().Be(2010);
                    items[1].Movie.Ids.Should().NotBeNull();
                    items[1].Movie.Ids.Trakt.Should().Be(12601U);
                    items[1].Movie.Ids.Slug.Should().Be("tron-legacy-2010");
                    items[1].Movie.Ids.Imdb.Should().Be("tt1104001");
                    items[1].Movie.Ids.Tmdb.Should().Be(20526U);
                }
        }
예제 #3
0
        public async Task Test_PersonMovieCreditsCastItemArrayJsonReader_ReadObject_From_Stream_Not_Valid_3()
        {
            var jsonReader = new PersonMovieCreditsCastItemArrayJsonReader();

            using (var stream = JSON_NOT_VALID_3.ToStream())
            {
                var movieCreditsCastItems = await jsonReader.ReadArrayAsync(stream);

                movieCreditsCastItems.Should().NotBeNull();
                var items = movieCreditsCastItems.ToArray();

                items[0].Should().NotBeNull();
                items[0].Character.Should().BeNull();
                items[0].Movie.Should().NotBeNull();
                items[0].Movie.Title.Should().Be("Star Wars: The Force Awakens");
                items[0].Movie.Year.Should().Be(2015);
                items[0].Movie.Ids.Should().NotBeNull();
                items[0].Movie.Ids.Trakt.Should().Be(94024U);
                items[0].Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015");
                items[0].Movie.Ids.Imdb.Should().Be("tt2488496");
                items[0].Movie.Ids.Tmdb.Should().Be(140607U);

                items[1].Should().NotBeNull();
                items[1].Character.Should().Be("Sam Flynn");
                items[1].Movie.Should().BeNull();
            }
        }
예제 #4
0
        public async Task Test_PersonMovieCreditsCastItemArrayJsonReader_ReadObject_From_JsonReader_Incomplete_2()
        {
            var traktJsonReader = new PersonMovieCreditsCastItemArrayJsonReader();

            using (var reader = new StringReader(JSON_INCOMPLETE_2))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var movieCreditsCastItems = await traktJsonReader.ReadArrayAsync(jsonReader);

                    movieCreditsCastItems.Should().NotBeNull();
                    var items = movieCreditsCastItems.ToArray();

                    items[0].Should().NotBeNull();
                    items[0].Character.Should().Be("Joe Brody");
                    items[0].Movie.Should().NotBeNull();
                    items[0].Movie.Title.Should().Be("Star Wars: The Force Awakens");
                    items[0].Movie.Year.Should().Be(2015);
                    items[0].Movie.Ids.Should().NotBeNull();
                    items[0].Movie.Ids.Trakt.Should().Be(94024U);
                    items[0].Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015");
                    items[0].Movie.Ids.Imdb.Should().Be("tt2488496");
                    items[0].Movie.Ids.Tmdb.Should().Be(140607U);

                    items[1].Should().NotBeNull();
                    items[1].Character.Should().Be("Sam Flynn");
                    items[1].Movie.Should().BeNull();
                }
        }
        public async Task Test_PersonMovieCreditsCastItemArrayJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new PersonMovieCreditsCastItemArrayJsonReader();

            var movieCreditsCastItems = await jsonReader.ReadArrayAsync(string.Empty);

            movieCreditsCastItems.Should().BeNull();
        }
        public async Task Test_PersonMovieCreditsCastItemArrayJsonReader_ReadArray_From_Json_String_Empty_Array()
        {
            var jsonReader = new PersonMovieCreditsCastItemArrayJsonReader();

            var movieCreditsCastItems = await jsonReader.ReadArrayAsync(JSON_EMPTY_ARRAY);

            movieCreditsCastItems.Should().NotBeNull().And.BeEmpty();
        }
예제 #7
0
        public async Task Test_PersonMovieCreditsCastItemArrayJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new PersonMovieCreditsCastItemArrayJsonReader();

            var movieCreditsCastItems = await jsonReader.ReadArrayAsync(default(Stream));

            movieCreditsCastItems.Should().BeNull();
        }
예제 #8
0
        public async Task Test_PersonMovieCreditsCastItemArrayJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new PersonMovieCreditsCastItemArrayJsonReader();

            var movieCreditsCastItems = await traktJsonReader.ReadArrayAsync(default(JsonTextReader));

            movieCreditsCastItems.Should().BeNull();
        }
예제 #9
0
        public async Task Test_PersonMovieCreditsCastItemArrayJsonReader_ReadObject_From_Stream_Empty()
        {
            var jsonReader = new PersonMovieCreditsCastItemArrayJsonReader();

            using (var stream = string.Empty.ToStream())
            {
                var movieCreditsCastItems = await jsonReader.ReadArrayAsync(stream);

                movieCreditsCastItems.Should().BeNull();
            }
        }
예제 #10
0
        public async Task Test_PersonMovieCreditsCastItemArrayJsonReader_ReadArray_From_Stream_Empty_Array()
        {
            var jsonReader = new PersonMovieCreditsCastItemArrayJsonReader();

            using (var stream = JSON_EMPTY_ARRAY.ToStream())
            {
                var movieCreditsCastItems = await jsonReader.ReadArrayAsync(stream);

                movieCreditsCastItems.Should().NotBeNull().And.BeEmpty();
            }
        }
예제 #11
0
        public async Task Test_PersonMovieCreditsCastItemArrayJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new PersonMovieCreditsCastItemArrayJsonReader();

            using (var reader = new StringReader(string.Empty))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var movieCreditsCastItems = await traktJsonReader.ReadArrayAsync(jsonReader);

                    movieCreditsCastItems.Should().BeNull();
                }
        }
예제 #12
0
        public async Task Test_PersonMovieCreditsCastItemArrayJsonReader_ReadArray_From_JsonReader_Empty_Array()
        {
            var traktJsonReader = new PersonMovieCreditsCastItemArrayJsonReader();

            using (var reader = new StringReader(JSON_EMPTY_ARRAY))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var movieCreditsCastItems = await traktJsonReader.ReadArrayAsync(jsonReader);

                    movieCreditsCastItems.Should().NotBeNull().And.BeEmpty();
                }
        }