public void ClippingCanvasTest_notree() { var mine = new UserControlPoker() { Width = 30, Height = 30 }; var content = new Canvas() { Width = 50, Height = 50 }; mine.SetContent(content); mine.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity)); Assert.AreEqual(new Size(30, 30), mine.MeasureArg, "MeasureArg"); Assert.AreEqual(new Size(30, 30), mine.MeasureResult, "MeasureResult"); Assert.AreEqual(new Size(30, 30), mine.DesiredSize, "poker Desired"); Assert.AreEqual(new Size(30, 30), content.DesiredSize, "canvas desired"); mine.Arrange(new Rect(0, 0, mine.DesiredSize.Width, mine.DesiredSize.Height)); Assert.AreEqual(new Size(30, 30), mine.ArrangeArg, "ArrangeArg"); Assert.AreEqual(new Size(30, 30), mine.ArrangeResult, "ArrangeResult"); Assert.AreEqual(new Size(50, 50), new Size(content.ActualWidth, content.ActualHeight), "content actual"); Assert.AreEqual(new Size(50, 50), content.RenderSize, "content rendersize"); Assert.AreEqual(new Rect(0, 0, 30, 30), LayoutInformation.GetLayoutSlot(content), "content slot"); Assert.IsNull(LayoutInformation.GetLayoutClip(content), "clip"); }
public void ChildlessMarginMeasureTest() { UserControlPoker p = new UserControlPoker(); p.Margin = new Thickness(10); p.Measure(new Size(10, 10)); Assert.AreEqual(new Size(10, 10), p.DesiredSize, "DesiredSize"); }
public void ChildlessMeasureTest() { UserControlPoker p = new UserControlPoker(); Size s = new Size(10, 10); p.Measure(s); Assert.AreEqual(new Size(0, 0), p.DesiredSize, "DesiredSize"); }
public void ChildlessMinHeightMeasureTest2() { UserControlPoker p = new UserControlPoker(); p.MinHeight = 5; Size s = new Size(10, 10); p.Measure(s); Assert.AreEqual(5, p.DesiredSize.Height); }
public void ChildlessMinWidthMeasureTest1() { UserControlPoker p = new UserControlPoker(); p.MinWidth = 50; Size s = new Size(10, 10); p.Measure(s); Assert.AreEqual(10, p.DesiredSize.Width); }
public void ChildMeasureTest2() { UserControlPoker p = new UserControlPoker(); Rectangle r = new Rectangle(); p.SetContent(r); r.Width = 50; r.Height = 50; p.Measure(new Size(100, 100)); Assert.AreEqual(new Size(50, 50), p.DesiredSize); }
public void ChildThicknessMeasureTest1() { UserControlPoker p = new UserControlPoker(); Rectangle r = new Rectangle(); p.Margin = new Thickness(5); p.SetContent(r); r.Width = 50; r.Height = 50; p.Measure(new Size(10, 10)); Assert.AreEqual(new Size(10, 10), p.DesiredSize); }
public void ChildMeasureTest1 () { UserControlPoker p = new UserControlPoker (); Rectangle r = new Rectangle (); p.SetContent (r); r.Width = 50; r.Height = 50; p.Measure (new Size (10, 10)); Assert.AreEqual (new Size (10, 10), p.DesiredSize); }
public void ChildThicknessMeasureTest2 () { UserControlPoker p = new UserControlPoker (); Rectangle r = new Rectangle (); p.Margin = new Thickness (5); p.SetContent (r); r.Width = 50; r.Height = 50; p.Measure (new Size (100, 100)); Assert.AreEqual (new Size (60, 60), p.DesiredSize); }
public void ChildlessMinHeightMeasureTest2 () { UserControlPoker p = new UserControlPoker (); p.MinHeight = 5; Size s = new Size (10, 10); p.Measure (s); Assert.AreEqual (5, p.DesiredSize.Height); }
public void ChildlessMinWidthMeasureTest1 () { UserControlPoker p = new UserControlPoker (); p.MinWidth = 50; Size s = new Size (10, 10); p.Measure (s); Assert.AreEqual (10, p.DesiredSize.Width); }
public void ChildlessMarginMeasureTest () { UserControlPoker p = new UserControlPoker (); p.Margin = new Thickness (10); p.Measure (new Size (10, 10)); Assert.AreEqual (new Size (10, 10), p.DesiredSize, "DesiredSize"); }
public void ChildlessMeasureTest () { UserControlPoker p = new UserControlPoker (); Size s = new Size (10, 10); p.Measure (s); Assert.AreEqual (new Size (0, 0), p.DesiredSize, "DesiredSize"); }
public void ClippingCanvasTest_notree () { var mine = new UserControlPoker () { Width = 30, Height = 30 }; var content = new Canvas () { Width = 50, Height = 50 }; mine.SetContent (content); mine.Measure (new Size (Double.PositiveInfinity, Double.PositiveInfinity)); Assert.AreEqual (new Size (30, 30), mine.MeasureArg, "MeasureArg"); Assert.AreEqual (new Size (30, 30), mine.MeasureResult, "MeasureResult"); Assert.AreEqual (new Size (30, 30), mine.DesiredSize, "poker Desired"); Assert.AreEqual (new Size (30, 30), content.DesiredSize, "canvas desired"); mine.Arrange (new Rect (0,0, mine.DesiredSize.Width, mine.DesiredSize.Height)); Assert.AreEqual (new Size (30, 30), mine.ArrangeArg, "ArrangeArg"); Assert.AreEqual (new Size (30, 30), mine.ArrangeResult, "ArrangeResult"); Assert.AreEqual (new Size (50, 50), new Size (content.ActualWidth, content.ActualHeight), "content actual"); Assert.AreEqual (new Size (50, 50), content.RenderSize, "content rendersize"); Assert.AreEqual (new Rect (0,0,30,30), LayoutInformation.GetLayoutSlot (content), "content slot"); Assert.IsNull (LayoutInformation.GetLayoutClip (content), "clip"); }