public void provide_value_returns_default_type_converter_if_no_source_or_target_type_information_is_provided()
        {
            var converterExtension = new TypeConverterExtension();
            var typeConverter      = converterExtension.ProvideValue(null) as TypeConverter;

            Assert.Null(typeConverter.SourceType);
            Assert.Null(typeConverter.TargetType);
        }
        public void provide_value_returns_appropriate_type_converter_if_target_type_is_set()
        {
            var converterExtension = new TypeConverterExtension
            {
                TargetType = typeof(int)
            };
            var typeConverter = converterExtension.ProvideValue(null) as TypeConverter;

            Assert.Equal(typeof(int), typeConverter.TargetType);
        }
        public void provide_value_returns_appropriate_type_converter_if_source_type_name_is_set()
        {
            var converterExtension = new TypeConverterExtension
            {
                SourceTypeName = "sys:Int32"
            };
            var xamlTypeResolverMock = new Mock <IXamlTypeResolver>();
            var serviceProviderMock  = new Mock <IServiceProvider>();

            xamlTypeResolverMock.Setup(x => x.Resolve("sys:Int32")).Returns(typeof(int));
            serviceProviderMock.Setup(x => x.GetService(typeof(IXamlTypeResolver))).Returns(xamlTypeResolverMock.Object);

            var typeConverter = converterExtension.ProvideValue(serviceProviderMock.Object) as TypeConverter;

            Assert.Equal(typeof(int), typeConverter.SourceType);
        }