Example #1
0
        public async Task Test_PersonIdsObjectJsonReader_ReadObject_From_Stream_Not_Valid_3()
        {
            var traktJsonReader = new PersonIdsObjectJsonReader();

            using (var stream = JSON_NOT_VALID_3.ToStream())
            {
                var traktPersonIds = await traktJsonReader.ReadObjectAsync(stream);

                traktPersonIds.Should().NotBeNull();
                traktPersonIds.Trakt.Should().Be(297737);
                traktPersonIds.Slug.Should().Be("bryan-cranston");
                traktPersonIds.Imdb.Should().BeNull();
                traktPersonIds.Tmdb.Should().Be(17419U);
                traktPersonIds.TvRage.Should().Be(1797U);
            }
        }
Example #2
0
        public async Task Test_PersonIdsObjectJsonReader_ReadObject_From_Stream_Incomplete_10()
        {
            var traktJsonReader = new PersonIdsObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_10.ToStream())
            {
                var traktPersonIds = await traktJsonReader.ReadObjectAsync(stream);

                traktPersonIds.Should().NotBeNull();
                traktPersonIds.Trakt.Should().Be(0);
                traktPersonIds.Slug.Should().BeNull();
                traktPersonIds.Imdb.Should().BeNull();
                traktPersonIds.Tmdb.Should().BeNull();
                traktPersonIds.TvRage.Should().Be(1797U);
            }
        }
Example #3
0
        public async Task Test_PersonIdsObjectJsonReader_ReadObject_From_Stream_Complete()
        {
            var traktJsonReader = new PersonIdsObjectJsonReader();

            using (var stream = JSON_COMPLETE.ToStream())
            {
                var traktPersonIds = await traktJsonReader.ReadObjectAsync(stream);

                traktPersonIds.Should().NotBeNull();
                traktPersonIds.Trakt.Should().Be(297737);
                traktPersonIds.Slug.Should().Be("bryan-cranston");
                traktPersonIds.Imdb.Should().Be("nm0186505");
                traktPersonIds.Tmdb.Should().Be(17419U);
                traktPersonIds.TvRage.Should().Be(1797U);
            }
        }
Example #4
0
        public async Task Test_PersonIdsObjectJsonReader_ReadObject_From_Stream_Not_Valid_6()
        {
            var traktJsonReader = new PersonIdsObjectJsonReader();

            using (var stream = JSON_NOT_VALID_6.ToStream())
            {
                var traktPersonIds = await traktJsonReader.ReadObjectAsync(stream);

                traktPersonIds.Should().NotBeNull();
                traktPersonIds.Trakt.Should().Be(0);
                traktPersonIds.Slug.Should().BeNull();
                traktPersonIds.Imdb.Should().BeNull();
                traktPersonIds.Tmdb.Should().BeNull();
                traktPersonIds.TvRage.Should().BeNull();
            }
        }
Example #5
0
        public async Task Test_PersonIdsObjectJsonReader_ReadObject_From_JsonReader_Incomplete_4()
        {
            var traktJsonReader = new PersonIdsObjectJsonReader();

            using (var reader = new StringReader(JSON_INCOMPLETE_4))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var traktPersonIds = await traktJsonReader.ReadObjectAsync(jsonReader);

                    traktPersonIds.Should().NotBeNull();
                    traktPersonIds.Trakt.Should().Be(297737);
                    traktPersonIds.Slug.Should().Be("bryan-cranston");
                    traktPersonIds.Imdb.Should().Be("nm0186505");
                    traktPersonIds.Tmdb.Should().BeNull();
                    traktPersonIds.TvRage.Should().Be(1797U);
                }
        }
Example #6
0
        public async Task Test_PersonIdsObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_6()
        {
            var traktJsonReader = new PersonIdsObjectJsonReader();

            using (var reader = new StringReader(JSON_NOT_VALID_6))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var traktPersonIds = await traktJsonReader.ReadObjectAsync(jsonReader);

                    traktPersonIds.Should().NotBeNull();
                    traktPersonIds.Trakt.Should().Be(0);
                    traktPersonIds.Slug.Should().BeNull();
                    traktPersonIds.Imdb.Should().BeNull();
                    traktPersonIds.Tmdb.Should().BeNull();
                    traktPersonIds.TvRage.Should().BeNull();
                }
        }
Example #7
0
        public async Task Test_PersonIdsObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_5()
        {
            var traktJsonReader = new PersonIdsObjectJsonReader();

            using (var reader = new StringReader(JSON_NOT_VALID_5))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var traktPersonIds = await traktJsonReader.ReadObjectAsync(jsonReader);

                    traktPersonIds.Should().NotBeNull();
                    traktPersonIds.Trakt.Should().Be(297737);
                    traktPersonIds.Slug.Should().Be("bryan-cranston");
                    traktPersonIds.Imdb.Should().Be("nm0186505");
                    traktPersonIds.Tmdb.Should().Be(17419U);
                    traktPersonIds.TvRage.Should().BeNull();
                }
        }
Example #8
0
        public async Task Test_PersonIdsObjectJsonReader_ReadObject_From_JsonReader_Incomplete_9()
        {
            var traktJsonReader = new PersonIdsObjectJsonReader();

            using (var reader = new StringReader(JSON_INCOMPLETE_9))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var traktPersonIds = await traktJsonReader.ReadObjectAsync(jsonReader);

                    traktPersonIds.Should().NotBeNull();
                    traktPersonIds.Trakt.Should().Be(0);
                    traktPersonIds.Slug.Should().BeNull();
                    traktPersonIds.Imdb.Should().BeNull();
                    traktPersonIds.Tmdb.Should().Be(17419U);
                    traktPersonIds.TvRage.Should().BeNull();
                }
        }
Example #9
0
 public async Task Test_PersonIdsObjectJsonReader_ReadObject_From_Stream_Null()
 {
     var traktJsonReader = new PersonIdsObjectJsonReader();
     Func <Task <ITraktPersonIds> > traktPersonIds = () => traktJsonReader.ReadObjectAsync(default(Stream));
     await traktPersonIds.Should().ThrowAsync <ArgumentNullException>();
 }