public void Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_Json_String_Null()
        {
            var jsonReader = new UserNetworkStatisticsObjectJsonReader();
            Func <Task <ITraktUserNetworkStatistics> > userNetworkStatistics = () => jsonReader.ReadObjectAsync(default(string));

            userNetworkStatistics.Should().Throw <ArgumentNullException>();
        }
        public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new UserNetworkStatisticsObjectJsonReader();

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

            userNetworkStatistics.Should().BeNull();
        }
        public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new UserNetworkStatisticsObjectJsonReader();

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

            userNetworkStatistics.Should().BeNull();
        }
        public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new UserNetworkStatisticsObjectJsonReader();

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

            userNetworkStatistics.Should().BeNull();
        }
Example #5
0
        public async Task Test_TraktUserNetworkStatistics_From_Json()
        {
            var jsonReader            = new UserNetworkStatisticsObjectJsonReader();
            var userNetworkStatistics = await jsonReader.ReadObjectAsync(JSON) as TraktUserNetworkStatistics;

            userNetworkStatistics.Should().NotBeNull();
            userNetworkStatistics.Friends.Should().Be(1);
            userNetworkStatistics.Followers.Should().Be(4);
            userNetworkStatistics.Following.Should().Be(11);
        }
        public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_Json_String_Incomplete_6()
        {
            var jsonReader = new UserNetworkStatisticsObjectJsonReader();

            var userNetworkStatistics = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_6);

            userNetworkStatistics.Should().NotBeNull();
            userNetworkStatistics.Friends.Should().BeNull();
            userNetworkStatistics.Followers.Should().BeNull();
            userNetworkStatistics.Following.Should().Be(11);
        }
        public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_Json_String_Not_Valid_4()
        {
            var jsonReader = new UserNetworkStatisticsObjectJsonReader();

            var userNetworkStatistics = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_4);

            userNetworkStatistics.Should().NotBeNull();
            userNetworkStatistics.Friends.Should().BeNull();
            userNetworkStatistics.Followers.Should().BeNull();
            userNetworkStatistics.Following.Should().BeNull();
        }
        public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var jsonReader = new UserNetworkStatisticsObjectJsonReader();

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

                userNetworkStatistics.Should().BeNull();
            }
        }
        public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new UserNetworkStatisticsObjectJsonReader();

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

                    userNetworkStatistics.Should().BeNull();
                }
        }
        public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_Stream_Incomplete_5()
        {
            var jsonReader = new UserNetworkStatisticsObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_5.ToStream())
            {
                var userNetworkStatistics = await jsonReader.ReadObjectAsync(stream);

                userNetworkStatistics.Should().NotBeNull();
                userNetworkStatistics.Friends.Should().BeNull();
                userNetworkStatistics.Followers.Should().Be(4);
                userNetworkStatistics.Following.Should().BeNull();
            }
        }
        public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new UserNetworkStatisticsObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var userNetworkStatistics = await jsonReader.ReadObjectAsync(stream);

                userNetworkStatistics.Should().NotBeNull();
                userNetworkStatistics.Friends.Should().BeNull();
                userNetworkStatistics.Followers.Should().BeNull();
                userNetworkStatistics.Following.Should().BeNull();
            }
        }
        public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_JsonReader_Incomplete_4()
        {
            var traktJsonReader = new UserNetworkStatisticsObjectJsonReader();

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

                    userNetworkStatistics.Should().NotBeNull();
                    userNetworkStatistics.Friends.Should().Be(1);
                    userNetworkStatistics.Followers.Should().BeNull();
                    userNetworkStatistics.Following.Should().BeNull();
                }
        }
        public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_3()
        {
            var traktJsonReader = new UserNetworkStatisticsObjectJsonReader();

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

                    userNetworkStatistics.Should().NotBeNull();
                    userNetworkStatistics.Friends.Should().Be(1);
                    userNetworkStatistics.Followers.Should().Be(4);
                    userNetworkStatistics.Following.Should().BeNull();
                }
        }
 public async Task Test_UserNetworkStatisticsObjectJsonReader_ReadObject_From_JsonReader_Null()
 {
     var traktJsonReader = new UserNetworkStatisticsObjectJsonReader();
     Func <Task <ITraktUserNetworkStatistics> > userNetworkStatistics = () => traktJsonReader.ReadObjectAsync(default(JsonTextReader));
     await userNetworkStatistics.Should().ThrowAsync <ArgumentNullException>();
 }