Beispiel #1
0
        public void Test_UserSeasonsStatisticsObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new UserSeasonsStatisticsObjectJsonReader();
            Func <Task <ITraktUserSeasonsStatistics> > userSeasonsStatistics = () => jsonReader.ReadObjectAsync(default(Stream));

            userSeasonsStatistics.Should().Throw <ArgumentNullException>();
        }
Beispiel #2
0
        public async Task Test_UserSeasonsStatisticsObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new UserSeasonsStatisticsObjectJsonReader();

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

            userSeasonsStatistics.Should().BeNull();
        }
Beispiel #3
0
        public async Task Test_UserSeasonsStatisticsObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new UserSeasonsStatisticsObjectJsonReader();

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

            userSeasonsStatistics.Should().BeNull();
        }
Beispiel #4
0
        public async Task Test_UserSeasonsStatisticsObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new UserSeasonsStatisticsObjectJsonReader();

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

            userSeasonsStatistics.Should().BeNull();
        }
Beispiel #5
0
        public async Task Test_TraktUserSeasonsStatistics_From_Json()
        {
            var jsonReader            = new UserSeasonsStatisticsObjectJsonReader();
            var userSeasonsStatistics = await jsonReader.ReadObjectAsync(JSON) as TraktUserSeasonsStatistics;

            userSeasonsStatistics.Should().NotBeNull();
            userSeasonsStatistics.Ratings.Should().Be(6);
            userSeasonsStatistics.Comments.Should().Be(1);
        }
Beispiel #6
0
        public async Task Test_UserSeasonsStatisticsObjectJsonReader_ReadObject_From_Json_String_Not_Valid_3()
        {
            var jsonReader = new UserSeasonsStatisticsObjectJsonReader();

            var userSeasonsStatistics = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_3);

            userSeasonsStatistics.Should().NotBeNull();
            userSeasonsStatistics.Ratings.Should().BeNull();
            userSeasonsStatistics.Comments.Should().BeNull();
        }
Beispiel #7
0
        public async Task Test_UserSeasonsStatisticsObjectJsonReader_ReadObject_From_Json_String_Incomplete_2()
        {
            var jsonReader = new UserSeasonsStatisticsObjectJsonReader();

            var userSeasonsStatistics = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_2);

            userSeasonsStatistics.Should().NotBeNull();
            userSeasonsStatistics.Ratings.Should().Be(6);
            userSeasonsStatistics.Comments.Should().BeNull();
        }
Beispiel #8
0
        public async Task Test_UserSeasonsStatisticsObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var jsonReader = new UserSeasonsStatisticsObjectJsonReader();

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

                userSeasonsStatistics.Should().BeNull();
            }
        }
        public async Task Test_UserSeasonsStatisticsObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new UserSeasonsStatisticsObjectJsonReader();

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

                    userSeasonsStatistics.Should().BeNull();
                }
        }
Beispiel #10
0
        public async Task Test_UserSeasonsStatisticsObjectJsonReader_ReadObject_From_Stream_Not_Valid_3()
        {
            var jsonReader = new UserSeasonsStatisticsObjectJsonReader();

            using (var stream = JSON_NOT_VALID_3.ToStream())
            {
                var userSeasonsStatistics = await jsonReader.ReadObjectAsync(stream);

                userSeasonsStatistics.Should().NotBeNull();
                userSeasonsStatistics.Ratings.Should().BeNull();
                userSeasonsStatistics.Comments.Should().BeNull();
            }
        }
Beispiel #11
0
        public async Task Test_UserSeasonsStatisticsObjectJsonReader_ReadObject_From_Stream_Incomplete_2()
        {
            var jsonReader = new UserSeasonsStatisticsObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_2.ToStream())
            {
                var userSeasonsStatistics = await jsonReader.ReadObjectAsync(stream);

                userSeasonsStatistics.Should().NotBeNull();
                userSeasonsStatistics.Ratings.Should().Be(6);
                userSeasonsStatistics.Comments.Should().BeNull();
            }
        }
        public async Task Test_UserSeasonsStatisticsObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_3()
        {
            var traktJsonReader = new UserSeasonsStatisticsObjectJsonReader();

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

                    userSeasonsStatistics.Should().NotBeNull();
                    userSeasonsStatistics.Ratings.Should().BeNull();
                    userSeasonsStatistics.Comments.Should().BeNull();
                }
        }
        public async Task Test_UserSeasonsStatisticsObjectJsonReader_ReadObject_From_JsonReader_Incomplete_2()
        {
            var traktJsonReader = new UserSeasonsStatisticsObjectJsonReader();

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

                    userSeasonsStatistics.Should().NotBeNull();
                    userSeasonsStatistics.Ratings.Should().Be(6);
                    userSeasonsStatistics.Comments.Should().BeNull();
                }
        }
Beispiel #14
0
 public async Task Test_UserSeasonsStatisticsObjectJsonReader_ReadObject_From_Json_String_Null()
 {
     var jsonReader = new UserSeasonsStatisticsObjectJsonReader();
     Func <Task <ITraktUserSeasonsStatistics> > userSeasonsStatistics = () => jsonReader.ReadObjectAsync(default(string));
     await userSeasonsStatistics.Should().ThrowAsync <ArgumentNullException>();
 }