public void TestCanConvertFrom() { Assert.IsTrue(imgFmtConv.CanConvertFrom(typeof(String)), "CCF#1"); Assert.IsTrue(imgFmtConv.CanConvertFrom(null, typeof(String)), "CCF#1a"); Assert.IsTrue(!imgFmtConv.CanConvertFrom(null, typeof(ImageFormat)), "CCF#2"); Assert.IsTrue(!imgFmtConv.CanConvertFrom(null, typeof(Guid)), "CCF#3"); Assert.IsTrue(!imgFmtConv.CanConvertFrom(null, typeof(Object)), "CCF#4"); Assert.IsTrue(!imgFmtConv.CanConvertFrom(null, typeof(int)), "CCF#5"); Assert.IsTrue(imgFmtConvFrmTD.CanConvertFrom(typeof(String)), "CCF#1A"); Assert.IsTrue(imgFmtConvFrmTD.CanConvertFrom(null, typeof(String)), "CCF#1aA"); Assert.IsTrue(!imgFmtConvFrmTD.CanConvertFrom(null, typeof(ImageFormat)), "CCF#2A"); Assert.IsTrue(!imgFmtConvFrmTD.CanConvertFrom(null, typeof(Guid)), "CCF#3A"); Assert.IsTrue(!imgFmtConvFrmTD.CanConvertFrom(null, typeof(Object)), "CCF#4A"); Assert.IsTrue(!imgFmtConvFrmTD.CanConvertFrom(null, typeof(int)), "CCF#5A"); }
public void TestCanConvertFrom() { Assert.True(_imgFmtConv.CanConvertFrom(typeof(string)), "string (no context)"); Assert.True(_imgFmtConv.CanConvertFrom(null, typeof(string)), "string"); Assert.False(_imgFmtConv.CanConvertFrom(null, typeof(ImageFormat)), "ImageFormat"); Assert.False(_imgFmtConv.CanConvertFrom(null, typeof(Guid)), "Guid"); Assert.False(_imgFmtConv.CanConvertFrom(null, typeof(object)), "object"); Assert.False(_imgFmtConv.CanConvertFrom(null, typeof(int)), "int"); Assert.True(_imgFmtConvFrmTD.CanConvertFrom(typeof(string)), "TD string (no context)"); Assert.True(_imgFmtConvFrmTD.CanConvertFrom(null, typeof(string)), "TD string"); Assert.False(_imgFmtConvFrmTD.CanConvertFrom(null, typeof(ImageFormat)), "TD ImageFormat"); Assert.False(_imgFmtConvFrmTD.CanConvertFrom(null, typeof(Guid)), "TD Guid"); Assert.False(_imgFmtConvFrmTD.CanConvertFrom(null, typeof(object)), "TD object"); Assert.False(_imgFmtConvFrmTD.CanConvertFrom(null, typeof(int)), "TD int"); }