public void Int32ConverterActivation() { // Arrange var expected = typeof (Int32Converter); var converterAttribute = new ConverterAttribute(expected); // Act var actual = converterAttribute.BuildConverter(); // Assert Assert.NotNull(actual); Assert.IsType<Int32Converter>(actual); }
internal static IConverter BuildConverter(this ConverterAttribute source) { Guard.NotNull(source, nameof(source)); return(Activator.CreateInstance(source.ConverterType) as IConverter); }