コード例 #1
0
        public void Resolve_TypeName_Is_Null()
        {
            // arrange
            var resolver = new ValueSerializerResolver(ValueSerializers.All);

            // act
            Action action = () => resolver.GetValueSerializer(null);

            // assert
            Assert.Throws <ArgumentNullException>(action);
        }
コード例 #2
0
        public void Resolve_Serializer_Not_Found()
        {
            // arrange
            var resolver = new ValueSerializerResolver(ValueSerializers.All);

            // act
            Action action = () => resolver.GetValueSerializer("Foo");

            // assert
            Assert.Throws <ArgumentException>(action);
        }
コード例 #3
0
        public void Resolve_Serializer()
        {
            // arrange
            var resolver = new ValueSerializerResolver(ValueSerializers.All);

            // act
            IValueSerializer serializer = resolver.GetValueSerializer("String");

            // assert
            Assert.NotNull(serializer);
            Assert.Equal("String", serializer.Name);
        }
コード例 #4
0
        public void Initialize_Input_Serializers()
        {
            // arrange
            var serializer = new InputSerializer();

            // act
            var resolver = new ValueSerializerResolver(
                new IValueSerializer[] { serializer });

            // assert
            Assert.True(serializer.IsInitialized);
        }