Beispiel #1
0
        public void Test_CertificationObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var traktJsonReader = new CertificationObjectJsonReader();
            Func <Task <ITraktCertification> > traktCertification = () => traktJsonReader.ReadObjectAsync(default(Stream));

            traktCertification.Should().Throw <ArgumentNullException>();
        }
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new CertificationObjectJsonReader();

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

            traktCertification.Should().BeNull();
        }
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new CertificationObjectJsonReader();

            var traktCertification = await traktJsonReader.ReadObjectAsync(default(JsonTextReader));

            traktCertification.Should().BeNull();
        }
Beispiel #4
0
        public async Task Test_TraktCertification_From_Json()
        {
            var jsonReader         = new CertificationObjectJsonReader();
            var traktCertification = await jsonReader.ReadObjectAsync(JSON) as TraktCertification;

            traktCertification.Should().NotBeNull();
            traktCertification.Name.Should().Be("PG");
            traktCertification.Slug.Should().Be("pg");
            traktCertification.Description.Should().Be("Parental Guidance Suggested");
        }
Beispiel #5
0
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var traktJsonReader = new CertificationObjectJsonReader();

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

                traktCertification.Should().BeNull();
            }
        }
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_Json_String_Incomplete_6()
        {
            var jsonReader = new CertificationObjectJsonReader();

            var traktCertification = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_6);

            traktCertification.Should().NotBeNull();
            traktCertification.Name.Should().BeNull();
            traktCertification.Slug.Should().BeNull();
            traktCertification.Description.Should().Be("Parental Guidance Suggested");
        }
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_Json_String_Not_Valid_4()
        {
            var jsonReader = new CertificationObjectJsonReader();

            var traktCertification = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_4);

            traktCertification.Should().NotBeNull();
            traktCertification.Name.Should().BeNull();
            traktCertification.Slug.Should().BeNull();
            traktCertification.Description.Should().BeNull();
        }
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_Json_String_Not_Valid_1()
        {
            var jsonReader = new CertificationObjectJsonReader();

            var traktCertification = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_1);

            traktCertification.Should().NotBeNull();
            traktCertification.Name.Should().BeNull();
            traktCertification.Slug.Should().Be("pg");
            traktCertification.Description.Should().Be("Parental Guidance Suggested");
        }
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new CertificationObjectJsonReader();

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

                    traktCertification.Should().BeNull();
                }
        }
Beispiel #10
0
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_Stream_Incomplete_5()
        {
            var traktJsonReader = new CertificationObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_5.ToStream())
            {
                var traktCertification = await traktJsonReader.ReadObjectAsync(stream);

                traktCertification.Should().NotBeNull();
                traktCertification.Name.Should().BeNull();
                traktCertification.Slug.Should().Be("pg");
                traktCertification.Description.Should().BeNull();
            }
        }
Beispiel #11
0
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new CertificationObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktCertification = await traktJsonReader.ReadObjectAsync(stream);

                traktCertification.Should().NotBeNull();
                traktCertification.Name.Should().BeNull();
                traktCertification.Slug.Should().BeNull();
                traktCertification.Description.Should().BeNull();
            }
        }
Beispiel #12
0
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_Stream_Complete()
        {
            var traktJsonReader = new CertificationObjectJsonReader();

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

                traktCertification.Should().NotBeNull();
                traktCertification.Name.Should().Be("PG");
                traktCertification.Slug.Should().Be("pg");
                traktCertification.Description.Should().Be("Parental Guidance Suggested");
            }
        }
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_JsonReader_Incomplete_4()
        {
            var traktJsonReader = new CertificationObjectJsonReader();

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

                    traktCertification.Should().NotBeNull();
                    traktCertification.Name.Should().Be("PG");
                    traktCertification.Slug.Should().BeNull();
                    traktCertification.Description.Should().BeNull();
                }
        }
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_4()
        {
            var traktJsonReader = new CertificationObjectJsonReader();

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

                    traktCertification.Should().NotBeNull();
                    traktCertification.Name.Should().BeNull();
                    traktCertification.Slug.Should().BeNull();
                    traktCertification.Description.Should().BeNull();
                }
        }
        public async Task Test_CertificationObjectJsonReader_ReadObject_From_JsonReader_Complete()
        {
            var traktJsonReader = new CertificationObjectJsonReader();

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

                    traktCertification.Should().NotBeNull();
                    traktCertification.Name.Should().Be("PG");
                    traktCertification.Slug.Should().Be("pg");
                    traktCertification.Description.Should().Be("Parental Guidance Suggested");
                }
        }
 public async Task Test_CertificationObjectJsonReader_ReadObject_From_JsonReader_Null()
 {
     var traktJsonReader = new CertificationObjectJsonReader();
     Func <Task <ITraktCertification> > traktCertification = () => traktJsonReader.ReadObjectAsync(default(JsonTextReader));
     await traktCertification.Should().ThrowAsync <ArgumentNullException>();
 }