public void Size () { BulletChrome b = new BulletChrome (); b.Measure (new Size (double.PositiveInfinity, double.PositiveInfinity)); Assert.AreEqual (b.DesiredSize.Width, 11, "Width"); Assert.AreEqual (b.DesiredSize.Height, 11, "Height"); b.Measure (new Size (1, 1)); Assert.AreEqual (b.DesiredSize.Width, 1, "Width with constraint"); Assert.AreEqual (b.DesiredSize.Height, 1, "Height with constraint"); b.Measure (new Size (1, 50)); Assert.AreEqual (b.DesiredSize.Width, 1, "Width with constraint 2"); Assert.AreEqual (b.DesiredSize.Height, 11, "Height with constraint 2"); b.BorderThickness = new Thickness (1, 2, 3, 4); b.Measure (new Size (double.PositiveInfinity, double.PositiveInfinity)); Assert.AreEqual (b.DesiredSize.Width, 15, "Width, border"); Assert.AreEqual (b.DesiredSize.Height, 17, "Height, border"); }
public void MeasureOverride () { BulletChrome b = new BulletChrome (); b.Measure (new Size (double.PositiveInfinity, 10)); Assert.AreEqual (b.DesiredSize.Width, 11, "Width"); Assert.AreEqual (b.DesiredSize.Height, 10, "Height"); }