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();
                }
        }
        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();
                }
        }
Beispiel #3
0
 public async Task Test_CountryObjectJsonReader_ReadObject_From_Stream_Null()
 {
     var traktJsonReader = new CountryObjectJsonReader();
     Func <Task <ITraktCountry> > traktCountry = () => traktJsonReader.ReadObjectAsync(default(Stream));
     await traktCountry.Should().ThrowAsync <ArgumentNullException>();
 }