public void ConvertFromNumberString() { var c = new SplitPanelLengthConverter(); var length = (SplitPanelLength)c.ConvertFrom(null, CultureInfo.InvariantCulture, "123.456"); Assert.IsTrue(length.IsAbsolute); Assert.AreEqual(123.456, length.Value); }
public void ConvertFromSingleStarString() { var c = new SplitPanelLengthConverter(); var length = (SplitPanelLength)c.ConvertFrom(null, CultureInfo.InvariantCulture, "*"); Assert.IsTrue(length.IsStar); Assert.AreEqual(1.0, length.Value); }
public void ConvertFromEmptyString() { var c = new SplitPanelLengthConverter(); var length = (SplitPanelLength)c.ConvertFrom(null, CultureInfo.InvariantCulture, string.Empty); Assert.IsTrue(length.IsAuto); Assert.AreEqual(0.0, length.Value); }
public void ConvertFromEmptyString() { var c = new SplitPanelLengthConverter(); var length = (SplitPanelLength)c.ConvertFrom(null, CultureInfo.InvariantCulture, string.Empty); Assert.IsTrue(length.IsAuto); Assert.AreEqual(0.0, length.Value); }
public void ConvertFromNumberString() { var c = new SplitPanelLengthConverter(); var length = (SplitPanelLength)c.ConvertFrom(null, CultureInfo.InvariantCulture, "123.456"); Assert.IsTrue(length.IsAbsolute); Assert.AreEqual(123.456, length.Value); }
public void ConvertFromSingleStarString() { var c = new SplitPanelLengthConverter(); var length = (SplitPanelLength)c.ConvertFrom(null, CultureInfo.InvariantCulture, "*"); Assert.IsTrue(length.IsStar); Assert.AreEqual(1.0, length.Value); }
public void ThrowOnConvertBrokenStarString() { var c = new SplitPanelLengthConverter(); Assert.Catch(() => c.ConvertFrom(null, CultureInfo.InvariantCulture, "NotANumber*")); }
public void CanConvertToString() { var c = new SplitPanelLengthConverter(); Assert.IsTrue(c.CanConvertTo(null, typeof(string))); }
public void ThrowOnConvertBrokenStarString() { var c = new SplitPanelLengthConverter(); Assert.Catch(() => c.ConvertFrom(null, CultureInfo.InvariantCulture, "NotANumber*")); }
public void CanConvertToString() { var c = new SplitPanelLengthConverter(); Assert.IsTrue(c.CanConvertTo(null, typeof(string))); }