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); }
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); }
public void ConvertToInvalidDestination() { new Action(() => _converter.ConvertTo(new Rect(), typeof(int))).ShouldThrow <NotSupportedException>(); }