public async Task Test_CountryObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var           jsonReader   = new CountryObjectJsonReader();
            ITraktCountry traktCountry = await jsonReader.ReadObjectAsync(string.Empty);

            traktCountry.Should().BeNull();
        }
        public async Task Test_CountryObjectJsonReader_ReadObject_From_Json_String_Not_Valid_3()
        {
            var           jsonReader   = new CountryObjectJsonReader();
            ITraktCountry traktCountry = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_3);

            traktCountry.Should().NotBeNull();
            traktCountry.Name.Should().BeNull();
            traktCountry.Code.Should().BeNull();
        }
        public async Task Test_CountryObjectJsonReader_ReadObject_From_Json_String_Incomplete_2()
        {
            var           jsonReader   = new CountryObjectJsonReader();
            ITraktCountry traktCountry = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_2);

            traktCountry.Should().NotBeNull();
            traktCountry.Name.Should().Be("Australia");
            traktCountry.Code.Should().BeNull();
        }
示例#4
0
        public async Task Test_CountryObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var traktJsonReader = new CountryObjectJsonReader();

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

                traktCountry.Should().BeNull();
            }
        }
示例#5
0
        public async Task Test_CountryObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new CountryObjectJsonReader();

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

                    traktCountry.Should().BeNull();
                }
        }
示例#6
0
        public async Task Test_CountryObjectJsonReader_ReadObject_From_Stream_Not_Valid_3()
        {
            var traktJsonReader = new CountryObjectJsonReader();

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

                traktCountry.Should().NotBeNull();
                traktCountry.Name.Should().BeNull();
                traktCountry.Code.Should().BeNull();
            }
        }
示例#7
0
        public async Task Test_CountryObjectJsonReader_ReadObject_From_Stream_Incomplete_2()
        {
            var traktJsonReader = new CountryObjectJsonReader();

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

                traktCountry.Should().NotBeNull();
                traktCountry.Name.Should().Be("Australia");
                traktCountry.Code.Should().BeNull();
            }
        }
示例#8
0
        public async Task Test_CountryObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_3()
        {
            var traktJsonReader = new CountryObjectJsonReader();

            using (var reader = new StringReader(JSON_NOT_VALID_3))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    ITraktCountry traktCountry = await traktJsonReader.ReadObjectAsync(jsonReader);

                    traktCountry.Should().NotBeNull();
                    traktCountry.Name.Should().BeNull();
                    traktCountry.Code.Should().BeNull();
                }
        }
示例#9
0
        public async Task Test_CountryObjectJsonReader_ReadObject_From_JsonReader_Incomplete_2()
        {
            var traktJsonReader = new CountryObjectJsonReader();

            using (var reader = new StringReader(JSON_INCOMPLETE_2))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    ITraktCountry traktCountry = await traktJsonReader.ReadObjectAsync(jsonReader);

                    traktCountry.Should().NotBeNull();
                    traktCountry.Name.Should().Be("Australia");
                    traktCountry.Code.Should().BeNull();
                }
        }