示例#1
0
        public void Test_UserIdsObjectJsonReader_ReadObject_From_Json_String_Null()
        {
            var jsonReader = new UserIdsObjectJsonReader();
            Func <Task <ITraktUserIds> > userIds = () => jsonReader.ReadObjectAsync(default(string));

            userIds.Should().Throw <ArgumentNullException>();
        }
        public async Task Test_UserIdsObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new UserIdsObjectJsonReader();

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

            userIds.Should().BeNull();
        }
示例#3
0
        public async Task Test_TraktUserIds_From_Json()
        {
            var jsonReader = new UserIdsObjectJsonReader();
            var userIds    = await jsonReader.ReadObjectAsync(JSON) as TraktUserIds;

            userIds.Should().NotBeNull();
            userIds.Slug.Should().Be("sean");
        }
示例#4
0
        public async Task Test_UserIdsObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new UserIdsObjectJsonReader();

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

            userIds.Should().BeNull();
        }
示例#5
0
        public async Task Test_UserIdsObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new UserIdsObjectJsonReader();

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

            userIds.Should().BeNull();
        }
示例#6
0
        public async Task Test_UserIdsObjectJsonReader_ReadObject_From_Json_String_Not_Valid()
        {
            var jsonReader = new UserIdsObjectJsonReader();

            var userIds = await jsonReader.ReadObjectAsync(JSON_NOT_VALID);

            userIds.Should().NotBeNull();
            userIds.Slug.Should().BeNull();
        }
示例#7
0
        public async Task Test_UserIdsObjectJsonReader_ReadObject_From_Json_String_Complete()
        {
            var jsonReader = new UserIdsObjectJsonReader();

            var userIds = await jsonReader.ReadObjectAsync(JSON_COMPLETE);

            userIds.Should().NotBeNull();
            userIds.Slug.Should().Be("sean");
        }
        public async Task Test_TraktUserIds_From_Json()
        {
            var jsonReader = new UserIdsObjectJsonReader();
            var userIds    = await jsonReader.ReadObjectAsync(JSON) as TraktUserIds;

            userIds.Should().NotBeNull();
            userIds.Slug.Should().Be("sean");
            userIds.UUID.Should().Be("b6589fc6ab0dc82cf12099d1c2d40ab994e8410c");
        }
示例#9
0
        public async Task Test_UserIdsObjectJsonReader_ReadObject_From_Json_String_Complete()
        {
            var jsonReader = new UserIdsObjectJsonReader();

            var userIds = await jsonReader.ReadObjectAsync(JSON_COMPLETE);

            userIds.Should().NotBeNull();
            userIds.Slug.Should().Be("sean");
            userIds.UUID.Should().Be("b6589fc6ab0dc82cf12099d1c2d40ab994e8410c");
        }
示例#10
0
        public async Task Test_UserIdsObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var jsonReader = new UserIdsObjectJsonReader();

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

                userIds.Should().BeNull();
            }
        }
        public async Task Test_UserIdsObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new UserIdsObjectJsonReader();

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

                    userIds.Should().BeNull();
                }
        }
示例#12
0
        public async Task Test_UserIdsObjectJsonReader_ReadObject_From_Stream_Not_Valid()
        {
            var jsonReader = new UserIdsObjectJsonReader();

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

                userIds.Should().NotBeNull();
                userIds.Slug.Should().BeNull();
            }
        }
示例#13
0
        public async Task Test_UserIdsObjectJsonReader_ReadObject_From_Stream_Complete()
        {
            var jsonReader = new UserIdsObjectJsonReader();

            using (var stream = JSON_COMPLETE.ToStream())
            {
                var userIds = await jsonReader.ReadObjectAsync(stream);

                userIds.Should().NotBeNull();
                userIds.Slug.Should().Be("sean");
            }
        }
        public async Task Test_UserIdsObjectJsonReader_ReadObject_From_JsonReader_Not_Valid()
        {
            var traktJsonReader = new UserIdsObjectJsonReader();

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

                    userIds.Should().NotBeNull();
                    userIds.Slug.Should().BeNull();
                }
        }
        public async Task Test_UserIdsObjectJsonReader_ReadObject_From_JsonReader_Complete()
        {
            var traktJsonReader = new UserIdsObjectJsonReader();

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

                    userIds.Should().NotBeNull();
                    userIds.Slug.Should().Be("sean");
                }
        }
示例#16
0
 public async Task Test_UserIdsObjectJsonReader_ReadObject_From_Stream_Null()
 {
     var jsonReader = new UserIdsObjectJsonReader();
     Func <Task <ITraktUserIds> > userIds = () => jsonReader.ReadObjectAsync(default(Stream));
     await userIds.Should().ThrowAsync <ArgumentNullException>();
 }