public static void CanConvertFromInt32() { // Arrange var converter = new DecimalConverter(); // Act var result = converter.CanConvertFrom(typeof(int)); // Assert Assert.True(result); }
public override bool CanConvertFrom(object sourceValue, Type destinationType) { if (sourceValue == null) { return(true); } if (sourceValue.GetType() == typeof(decimal)) { return(true); } DecimalConverter dc = new DecimalConverter(); return(dc.CanConvertFrom(sourceValue.GetType())); }