Example #1
0
        public void CanConvertToFalse(Type type)
        {
            var conv = new ColorConverter();

            Assert.False(conv.CanConvertTo(type));
            Assert.False(conv.CanConvertTo(null, type));
        }
 public void CanConvertTo()
 {
     Assert.IsTrue(colconv.CanConvertTo(typeof(String)), "CCT#1");
     Assert.IsTrue(colconv.CanConvertTo(null, typeof(String)), "CCT#1a");
     Assert.IsFalse(colconv.CanConvertTo(null, typeof(Rectangle)), "CCT#2");
     Assert.IsFalse(colconv.CanConvertTo(null, typeof(RectangleF)), "CCT#3");
     Assert.IsFalse(colconv.CanConvertTo(null, typeof(Point)), "CCT#4");
     Assert.IsFalse(colconv.CanConvertTo(null, typeof(PointF)), "CCT#5");
     Assert.IsFalse(colconv.CanConvertTo(null, typeof(Color)), "CCT#6");
     Assert.IsFalse(colconv.CanConvertTo(null, typeof(SizeF)), "CCT#7");
     Assert.IsFalse(colconv.CanConvertTo(null, typeof(Object)), "CCT#8");
     Assert.IsFalse(colconv.CanConvertTo(null, typeof(int)), "CCT#9");
     Assert.IsTrue(colconv.CanConvertTo(typeof(InstanceDescriptor)), "CCT#10");
 }