Ejemplo n.º 1
0
        public void ConvertTo()
        {
            RectConverter r = new RectConverter();

            Rect rect = new Rect(0, 0, 1, 2);

            object o = r.ConvertTo(rect, typeof(string));

            Assert.AreEqual(typeof(string), o.GetType());
            Assert.AreEqual("0,0,1,2", (string)o);
        }
Ejemplo n.º 2
0
        public void ConvertTo()
        {
            RectConverter r = new RectConverter();

            Rect rect = new Rect(0, 0, 1, 2);

            object o = r.ConvertTo(null, CultureInfo.InvariantCulture, rect, typeof(string));

            Assert.AreEqual(typeof(string), o.GetType());
            Assert.AreEqual("0,0,1,2", (string)o);
        }
Ejemplo n.º 3
0
 public void ConvertToInvalidDestination()
 {
     new Action(() => _converter.ConvertTo(new Rect(), typeof(int))).ShouldThrow <NotSupportedException>();
 }