public async Task Test_PersonShowCreditsCastItemArrayJsonReader_ReadObject_From_Json_String_Not_Valid_1()
        {
            var jsonReader = new PersonShowCreditsCastItemArrayJsonReader();

            var showCreditsCastItems = await jsonReader.ReadArrayAsync(JSON_NOT_VALID_1);

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

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

            items[1].Should().NotBeNull();
            items[1].Character.Should().Be("Iris West");
            items[1].Show.Should().NotBeNull();
            items[1].Show.Title.Should().Be("The Flash");
            items[1].Show.Year.Should().Be(2014);
            items[1].Show.Ids.Should().NotBeNull();
            items[1].Show.Ids.Trakt.Should().Be(60300U);
            items[1].Show.Ids.Slug.Should().Be("the-flash-2014");
            items[1].Show.Ids.Tvdb.Should().Be(279121U);
            items[1].Show.Ids.Imdb.Should().Be("tt3107288");
            items[1].Show.Ids.Tmdb.Should().Be(60735U);
            items[1].Show.Ids.TvRage.Should().Be(36939U);
        }
        public async Task Test_PersonShowCreditsCastItemArrayJsonReader_ReadObject_From_Json_String_Incomplete_2()
        {
            var jsonReader = new PersonShowCreditsCastItemArrayJsonReader();

            var showCreditsCastItems = await jsonReader.ReadArrayAsync(JSON_INCOMPLETE_2);

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

            items[0].Should().NotBeNull();
            items[0].Character.Should().Be("Joe Brody");
            items[0].Show.Should().NotBeNull();
            items[0].Show.Title.Should().Be("Game of Thrones");
            items[0].Show.Year.Should().Be(2011);
            items[0].Show.Ids.Should().NotBeNull();
            items[0].Show.Ids.Trakt.Should().Be(1390U);
            items[0].Show.Ids.Slug.Should().Be("game-of-thrones");
            items[0].Show.Ids.Tvdb.Should().Be(121361U);
            items[0].Show.Ids.Imdb.Should().Be("tt0944947");
            items[0].Show.Ids.Tmdb.Should().Be(1399U);
            items[0].Show.Ids.TvRage.Should().Be(24493U);

            items[1].Should().NotBeNull();
            items[1].Character.Should().Be("Iris West");
            items[1].Show.Should().BeNull();
        }
        public async Task Test_PersonShowCreditsCastItemArrayJsonReader_ReadObject_From_Stream_Not_Valid_3()
        {
            var traktJsonReader = new PersonShowCreditsCastItemArrayJsonReader();

            using (var stream = JSON_NOT_VALID_3.ToStream())
            {
                var showCreditsCastItems = await traktJsonReader.ReadArrayAsync(stream);

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

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

                items[1].Should().NotBeNull();
                items[1].Character.Should().Be("Iris West");
                items[1].Show.Should().BeNull();
            }
        }
        public async Task Test_PersonShowCreditsCastItemArrayJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new PersonShowCreditsCastItemArrayJsonReader();

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

            showCreditsCastItems.Should().BeNull();
        }
        public async Task Test_PersonShowCreditsCastItemArrayJsonReader_ReadArray_From_Json_String_Empty_Array()
        {
            var jsonReader = new PersonShowCreditsCastItemArrayJsonReader();

            var showCreditsCastItems = await jsonReader.ReadArrayAsync(JSON_EMPTY_ARRAY);

            showCreditsCastItems.Should().NotBeNull().And.BeEmpty();
        }
        public async Task Test_PersonShowCreditsCastItemArrayJsonReader_ReadObject_From_Stream_Null()
        {
            var traktJsonReader = new PersonShowCreditsCastItemArrayJsonReader();

            var showCreditsCastItems = await traktJsonReader.ReadArrayAsync(default(Stream));

            showCreditsCastItems.Should().BeNull();
        }
        public async Task Test_PersonShowCreditsCastItemArrayJsonReader_ReadObject_From_Stream_Empty()
        {
            var traktJsonReader = new PersonShowCreditsCastItemArrayJsonReader();

            using (var stream = string.Empty.ToStream())
            {
                var showCreditsCastItems = await traktJsonReader.ReadArrayAsync(stream);

                showCreditsCastItems.Should().BeNull();
            }
        }
        public async Task Test_PersonShowCreditsCastItemArrayJsonReader_ReadArray_From_Stream_Empty_Array()
        {
            var traktJsonReader = new PersonShowCreditsCastItemArrayJsonReader();

            using (var stream = JSON_EMPTY_ARRAY.ToStream())
            {
                var showCreditsCastItems = await traktJsonReader.ReadArrayAsync(stream);

                showCreditsCastItems.Should().NotBeNull().And.BeEmpty();
            }
        }
Example #9
0
        public async Task Test_PersonShowCreditsCastItemArrayJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new PersonShowCreditsCastItemArrayJsonReader();

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

                    showCreditsCastItems.Should().BeNull();
                }
        }
Example #10
0
        public async Task Test_PersonShowCreditsCastItemArrayJsonReader_ReadArray_From_JsonReader_Empty_Array()
        {
            var traktJsonReader = new PersonShowCreditsCastItemArrayJsonReader();

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

                    showCreditsCastItems.Should().NotBeNull().And.BeEmpty();
                }
        }
Example #11
0
        public async Task Test_PersonShowCreditsCastItemArrayJsonReader_ReadObject_From_JsonReader_Incomplete_1()
        {
            var traktJsonReader = new PersonShowCreditsCastItemArrayJsonReader();

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

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

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

                    items[1].Should().NotBeNull();
                    items[1].Character.Should().Be("Iris West");
                    items[1].Show.Should().NotBeNull();
                    items[1].Show.Title.Should().Be("The Flash");
                    items[1].Show.Year.Should().Be(2014);
                    items[1].Show.Ids.Should().NotBeNull();
                    items[1].Show.Ids.Trakt.Should().Be(60300U);
                    items[1].Show.Ids.Slug.Should().Be("the-flash-2014");
                    items[1].Show.Ids.Tvdb.Should().Be(279121U);
                    items[1].Show.Ids.Imdb.Should().Be("tt3107288");
                    items[1].Show.Ids.Tmdb.Should().Be(60735U);
                    items[1].Show.Ids.TvRage.Should().Be(36939U);
                }
        }