public void Test_GenreObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new GenreObjectJsonReader();
            Func <Task <ITraktGenre> > traktGenre = () => traktJsonReader.ReadObjectAsync(default(JsonTextReader));

            traktGenre.Should().Throw <ArgumentNullException>();
        }
Beispiel #2
0
        public async Task Test_GenreObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var traktJsonReader = new GenreObjectJsonReader();

            var traktGenre = await traktJsonReader.ReadObjectAsync(default(Stream));

            traktGenre.Should().BeNull();
        }
        public async Task Test_GenreObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new GenreObjectJsonReader();

            var traktGenre = await jsonReader.ReadObjectAsync(string.Empty);

            traktGenre.Should().BeNull();
        }
Beispiel #4
0
        public async Task Test_TraktGenre_From_Json()
        {
            var jsonReader = new GenreObjectJsonReader();
            var traktGenre = await jsonReader.ReadObjectAsync(JSON) as TraktGenre;

            traktGenre.Should().NotBeNull();
            traktGenre.Name.Should().Be("Action");
            traktGenre.Slug.Should().Be("action");
            traktGenre.Type.Should().BeNull();
        }
Beispiel #5
0
        public async Task Test_GenreObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var traktJsonReader = new GenreObjectJsonReader();

            using (var stream = string.Empty.ToStream())
            {
                var traktGenre = await traktJsonReader.ReadObjectAsync(stream);

                traktGenre.Should().BeNull();
            }
        }
        public async Task Test_GenreObjectJsonReader_ReadObject_From_Json_String_Not_Valid_3()
        {
            var jsonReader = new GenreObjectJsonReader();

            var traktGenre = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_3);

            traktGenre.Should().NotBeNull();
            traktGenre.Name.Should().BeNull();
            traktGenre.Slug.Should().BeNull();
            traktGenre.Type.Should().BeNull();
        }
        public async Task Test_GenreObjectJsonReader_ReadObject_From_Json_String_Incomplete_2()
        {
            var jsonReader = new GenreObjectJsonReader();

            var traktGenre = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_2);

            traktGenre.Should().NotBeNull();
            traktGenre.Name.Should().BeNull();
            traktGenre.Slug.Should().Be("action");
            traktGenre.Type.Should().BeNull();
        }
        public async Task Test_GenreObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new GenreObjectJsonReader();

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

                    traktGenre.Should().BeNull();
                }
        }
Beispiel #9
0
        public async Task Test_GenreObjectJsonReader_ReadObject_From_Stream_Not_Valid_3()
        {
            var traktJsonReader = new GenreObjectJsonReader();

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

                traktGenre.Should().NotBeNull();
                traktGenre.Name.Should().BeNull();
                traktGenre.Slug.Should().BeNull();
                traktGenre.Type.Should().BeNull();
            }
        }
Beispiel #10
0
        public async Task Test_GenreObjectJsonReader_ReadObject_From_Stream_Incomplete_2()
        {
            var traktJsonReader = new GenreObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_2.ToStream())
            {
                var traktGenre = await traktJsonReader.ReadObjectAsync(stream);

                traktGenre.Should().NotBeNull();
                traktGenre.Name.Should().BeNull();
                traktGenre.Slug.Should().Be("action");
                traktGenre.Type.Should().BeNull();
            }
        }
        public async Task Test_GenreObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_2()
        {
            var traktJsonReader = new GenreObjectJsonReader();

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

                    traktGenre.Should().NotBeNull();
                    traktGenre.Name.Should().BeNull();
                    traktGenre.Slug.Should().Be("action");
                    traktGenre.Type.Should().BeNull();
                }
        }
        public async Task Test_GenreObjectJsonReader_ReadObject_From_JsonReader_Incomplete_1()
        {
            var traktJsonReader = new GenreObjectJsonReader();

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

                    traktGenre.Should().NotBeNull();
                    traktGenre.Name.Should().Be("Action");
                    traktGenre.Slug.Should().BeNull();
                    traktGenre.Type.Should().BeNull();
                }
        }
 public async Task Test_GenreObjectJsonReader_ReadObject_From_Json_String_Null()
 {
     var jsonReader = new GenreObjectJsonReader();
     Func <Task <ITraktGenre> > traktGenre = () => jsonReader.ReadObjectAsync(default(string));
     await traktGenre.Should().ThrowAsync <ArgumentNullException>();
 }