public void CanConvertTo_True() { // same type Assert.That(_converterForString.CanConvertTo(_typeDescriptorContext, typeof(string)), Is.True); // from non-nullable to nullable Assert.That(_converterForInt.CanConvertTo(_typeDescriptorContext, typeof(int?)), Is.True); }
public void CanConvertTo_False() { // completely unrelated Assert.That(_converterForString.CanConvertTo(_typeDescriptorContext, typeof(int)), Is.False); // from base to derived type Assert.That(_converterForObject.CanConvertTo(_typeDescriptorContext, typeof(string)), Is.False); // from derived to base type Assert.That(_converterForString.CanConvertTo(_typeDescriptorContext, typeof(object)), Is.False); // from nullable to non-nullable Assert.That(_converterForNullableInt.CanConvertTo(_typeDescriptorContext, typeof(int)), Is.False); }