public void When_Measure_Empty() { var SUT = new MyPanel() { Name = "test" }; SUT.Measure(default(Windows.Foundation.Size)); var size = SUT.DesiredSize; SUT.Arrange(default(Windows.Foundation.Rect)); Assert.AreEqual(default(Windows.Foundation.Size), size); Assert.IsTrue(SUT.GetChildren().None()); }
public void When_Measure_OneItem() { var SUT = new MyPanel() { Name = "test" }; var item1 = new Border() { Width = 10, Height = 10 }; SUT.Children.Add(item1); SUT.Measure(new Size(20, 20)); var size = SUT.DesiredSize; SUT.Arrange(new Rect(0, 0, 10, 10)); Assert.AreEqual(new Size(10, 10), size); Assert.AreEqual(new Rect(0, 0, 10, 10), item1.Arranged); Assert.AreEqual(1, SUT.GetChildren().Count()); }