public void Test_UserImagesObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new UserImagesObjectJsonReader();
            Func <Task <ITraktUserImages> > userImages = () => jsonReader.ReadObjectAsync(default(Stream));

            userImages.Should().Throw <ArgumentNullException>();
        }
        public async Task Test_UserImagesObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new UserImagesObjectJsonReader();

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

            userImages.Should().BeNull();
        }
Exemple #3
0
        public async Task Test_UserImagesObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new UserImagesObjectJsonReader();

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

            userImages.Should().BeNull();
        }
Exemple #4
0
        public async Task Test_UserImagesObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new UserImagesObjectJsonReader();

            var userImages = await jsonReader.ReadObjectAsync(default(Stream));

            userImages.Should().BeNull();
        }
        public async Task Test_TraktUserImages_From_Json()
        {
            var jsonReader = new UserImagesObjectJsonReader();
            var userImages = await jsonReader.ReadObjectAsync(JSON) as TraktUserImages;

            userImages.Should().NotBeNull();
            userImages.Avatar.Should().NotBeNull();
            userImages.Avatar.Full.Should().Be("https://walter.trakt.us/images/users/000/359/474/avatars/large/58cc281a20.gif");
        }
Exemple #6
0
        public async Task Test_UserImagesObjectJsonReader_ReadObject_From_Json_String_Not_Valid()
        {
            var jsonReader = new UserImagesObjectJsonReader();

            var userImages = await jsonReader.ReadObjectAsync(JSON_NOT_VALID);

            userImages.Should().NotBeNull();
            userImages.Avatar.Should().BeNull();
        }
Exemple #7
0
        public async Task Test_UserImagesObjectJsonReader_ReadObject_From_Json_String_Complete()
        {
            var jsonReader = new UserImagesObjectJsonReader();

            var userImages = await jsonReader.ReadObjectAsync(JSON_COMPLETE);

            userImages.Should().NotBeNull();
            userImages.Avatar.Should().NotBeNull();
            userImages.Avatar.Full.Should().Be("https://walter.trakt.us/images/users/000/359/474/avatars/large/58cc281a20.gif");
        }
        public async Task Test_UserImagesObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var jsonReader = new UserImagesObjectJsonReader();

            using (var stream = string.Empty.ToStream())
            {
                var userImages = await jsonReader.ReadObjectAsync(stream);

                userImages.Should().BeNull();
            }
        }
        public async Task Test_UserImagesObjectJsonReader_ReadObject_From_Stream_Not_Valid()
        {
            var jsonReader = new UserImagesObjectJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var userImages = await jsonReader.ReadObjectAsync(stream);

                userImages.Should().NotBeNull();
                userImages.Avatar.Should().BeNull();
            }
        }
        public async Task Test_UserImagesObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new UserImagesObjectJsonReader();

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

                    userImages.Should().BeNull();
                }
        }
        public async Task Test_UserImagesObjectJsonReader_ReadObject_From_JsonReader_Not_Valid()
        {
            var traktJsonReader = new UserImagesObjectJsonReader();

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

                    userImages.Should().NotBeNull();
                    userImages.Avatar.Should().BeNull();
                }
        }
Exemple #12
0
 public async Task Test_UserImagesObjectJsonReader_ReadObject_From_JsonReader_Null()
 {
     var traktJsonReader = new UserImagesObjectJsonReader();
     Func <Task <ITraktUserImages> > userImages = () => traktJsonReader.ReadObjectAsync(default(JsonTextReader));
     await userImages.Should().ThrowAsync <ArgumentNullException>();
 }