Exemple #1
0
        public void TestCanConvertTo()
        {
            Assert.IsTrue(imgFmtConv.CanConvertTo(typeof(String)), "CCT#1");
            Assert.IsTrue(imgFmtConv.CanConvertTo(null, typeof(String)), "CCT#1a");
            Assert.IsTrue(!imgFmtConv.CanConvertTo(null, typeof(ImageFormat)), "CCT#2");
            Assert.IsTrue(!imgFmtConv.CanConvertTo(null, typeof(Guid)), "CCT#3");
            Assert.IsTrue(!imgFmtConv.CanConvertTo(null, typeof(Object)), "CCT#4");
            Assert.IsTrue(!imgFmtConv.CanConvertTo(null, typeof(int)), "CCT#5");

            Assert.IsTrue(imgFmtConvFrmTD.CanConvertTo(typeof(String)), "CCT#1A");
            Assert.IsTrue(imgFmtConvFrmTD.CanConvertTo(null, typeof(String)), "CCT#1aA");
            Assert.IsTrue(!imgFmtConvFrmTD.CanConvertTo(null, typeof(ImageFormat)), "CCT#2A");
            Assert.IsTrue(!imgFmtConvFrmTD.CanConvertTo(null, typeof(Guid)), "CCT#3A");
            Assert.IsTrue(!imgFmtConvFrmTD.CanConvertTo(null, typeof(Object)), "CCT#4A");
            Assert.IsTrue(!imgFmtConvFrmTD.CanConvertTo(null, typeof(int)), "CCT#5A");
        }
Exemple #2
0
        public void TestCanConvertTo()
        {
            Assert.True(_imgFmtConv.CanConvertTo(typeof(string)), "string (no context)");
            Assert.True(_imgFmtConv.CanConvertTo(null, typeof(string)), "string");
            Assert.False(_imgFmtConv.CanConvertTo(null, typeof(ImageFormat)), "ImageFormat");
            Assert.False(_imgFmtConv.CanConvertTo(null, typeof(Guid)), "Guid");
            Assert.False(_imgFmtConv.CanConvertTo(null, typeof(object)), "object");
            Assert.False(_imgFmtConv.CanConvertTo(null, typeof(int)), "int");

            Assert.True(_imgFmtConvFrmTD.CanConvertTo(typeof(string)), "TD string (no context)");
            Assert.True(_imgFmtConvFrmTD.CanConvertTo(null, typeof(string)), "TD string");
            Assert.False(_imgFmtConvFrmTD.CanConvertTo(null, typeof(ImageFormat)), "TD ImageFormat");
            Assert.False(_imgFmtConvFrmTD.CanConvertTo(null, typeof(Guid)), "TD Guid");
            Assert.False(_imgFmtConvFrmTD.CanConvertTo(null, typeof(object)), "TD object");
            Assert.False(_imgFmtConvFrmTD.CanConvertTo(null, typeof(int)), "TD int");
        }