public void Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();
            Func <Task <ITraktUserCustomListItemsPostResponseGroup> > customListItemsPostResponseGroup = () => jsonReader.ReadObjectAsync(default(Stream));

            customListItemsPostResponseGroup.Should().Throw <ArgumentNullException>();
        }
        public async Task Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();

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

            customListItemsPostResponseGroup.Should().BeNull();
        }
        public async Task Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();

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

            customListItemsPostResponseGroup.Should().BeNull();
        }
Пример #4
0
        public async Task Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();

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

            customListItemsPostResponseGroup.Should().BeNull();
        }
        public async Task Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var jsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();

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

                customListItemsPostResponseGroup.Should().BeNull();
            }
        }
        public async Task Test_TraktUserCustomListItemsPostResponseGroup_From_Json()
        {
            var jsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();
            var customListItemsPostResponseGroup = await jsonReader.ReadObjectAsync(JSON) as TraktUserCustomListItemsPostResponseGroup;

            customListItemsPostResponseGroup.Should().NotBeNull();
            customListItemsPostResponseGroup.Movies.Should().Be(1);
            customListItemsPostResponseGroup.Shows.Should().Be(2);
            customListItemsPostResponseGroup.Seasons.Should().Be(3);
            customListItemsPostResponseGroup.Episodes.Should().Be(4);
            customListItemsPostResponseGroup.People.Should().Be(5);
        }
        public async Task Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();

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

                    customListItemsPostResponseGroup.Should().BeNull();
                }
        }
        public async Task Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_Json_String_Incomplete_5()
        {
            var jsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();

            var customListItemsPostResponseGroup = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_5);

            customListItemsPostResponseGroup.Should().NotBeNull();
            customListItemsPostResponseGroup.Movies.Should().Be(1);
            customListItemsPostResponseGroup.Shows.Should().Be(2);
            customListItemsPostResponseGroup.Seasons.Should().Be(3);
            customListItemsPostResponseGroup.Episodes.Should().Be(4);
            customListItemsPostResponseGroup.People.Should().BeNull();
        }
        public async Task Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_Json_String_Not_Valid_6()
        {
            var jsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();

            var customListItemsPostResponseGroup = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_6);

            customListItemsPostResponseGroup.Should().NotBeNull();
            customListItemsPostResponseGroup.Movies.Should().BeNull();
            customListItemsPostResponseGroup.Shows.Should().BeNull();
            customListItemsPostResponseGroup.Seasons.Should().BeNull();
            customListItemsPostResponseGroup.Episodes.Should().BeNull();
            customListItemsPostResponseGroup.People.Should().BeNull();
        }
        public async Task Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_Stream_Incomplete_4()
        {
            var jsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_4.ToStream())
            {
                var customListItemsPostResponseGroup = await jsonReader.ReadObjectAsync(stream);

                customListItemsPostResponseGroup.Should().NotBeNull();
                customListItemsPostResponseGroup.Movies.Should().Be(1);
                customListItemsPostResponseGroup.Shows.Should().Be(2);
                customListItemsPostResponseGroup.Seasons.Should().Be(3);
                customListItemsPostResponseGroup.Episodes.Should().BeNull();
                customListItemsPostResponseGroup.People.Should().Be(5);
            }
        }
        public async Task Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_Stream_Not_Valid_5()
        {
            var jsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();

            using (var stream = JSON_NOT_VALID_5.ToStream())
            {
                var customListItemsPostResponseGroup = await jsonReader.ReadObjectAsync(stream);

                customListItemsPostResponseGroup.Should().NotBeNull();
                customListItemsPostResponseGroup.Movies.Should().Be(1);
                customListItemsPostResponseGroup.Shows.Should().Be(2);
                customListItemsPostResponseGroup.Seasons.Should().Be(3);
                customListItemsPostResponseGroup.Episodes.Should().Be(4);
                customListItemsPostResponseGroup.People.Should().BeNull();
            }
        }
        public async Task Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_JsonReader_Incomplete_4()
        {
            var traktJsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();

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

                    customListItemsPostResponseGroup.Should().NotBeNull();
                    customListItemsPostResponseGroup.Movies.Should().Be(1);
                    customListItemsPostResponseGroup.Shows.Should().Be(2);
                    customListItemsPostResponseGroup.Seasons.Should().Be(3);
                    customListItemsPostResponseGroup.Episodes.Should().BeNull();
                    customListItemsPostResponseGroup.People.Should().Be(5);
                }
        }
        public async Task Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_6()
        {
            var traktJsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();

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

                    customListItemsPostResponseGroup.Should().NotBeNull();
                    customListItemsPostResponseGroup.Movies.Should().BeNull();
                    customListItemsPostResponseGroup.Shows.Should().BeNull();
                    customListItemsPostResponseGroup.Seasons.Should().BeNull();
                    customListItemsPostResponseGroup.Episodes.Should().BeNull();
                    customListItemsPostResponseGroup.People.Should().BeNull();
                }
        }
 public async Task Test_UserCustomListItemsPostResponseGroupObjectJsonReader_ReadObject_From_Json_String_Null()
 {
     var jsonReader = new UserCustomListItemsPostResponseGroupObjectJsonReader();
     Func <Task <ITraktUserCustomListItemsPostResponseGroup> > customListItemsPostResponseGroup = () => jsonReader.ReadObjectAsync(default(string));
     await customListItemsPostResponseGroup.Should().ThrowAsync <ArgumentNullException>();
 }