示例#1
0
        public void MeasureEmptyMustNotCrash()
        {
            var g = new BoxGroup(LayoutTestStyle.Create());

            g.Measure(Size.Auto);

            g.DesiredSize.Should().Be(new Size());
        }
示例#2
0
        public void MeasureVertical()
        {
            var g = new BoxGroup(LayoutTestStyle.Create());

            g.Spacing = 5;
            g.Add(LayoutTestWidget.FixedSize(200, 100));
            g.Add(LayoutTestWidget.FixedSize(150, 50));

            g.Measure(Size.Auto);

            g.DesiredSize.Should().Be(new Size(200, 155));
            g[0].DesiredSize.Should().Be(new Size(200, 100));
            g[1].DesiredSize.Should().Be(new Size(150, 50));
        }
示例#3
0
        public void MeasureHorizontal()
        {
            var g = new BoxGroup(LayoutTestStyle.Create());

            g.Spacing     = 5;
            g.Orientation = Orientation.Horizontal;
            g.Add(LayoutTestWidget.FixedSize(200, 100));
            g.Add(LayoutTestWidget.FixedSize(150, 50));

            g.Measure(Size.Auto);

            g.DesiredSize.Should().Be(new Size(355, 100));
            g[0].DesiredSize.Should().Be(new Size(200, 100));
            g[1].DesiredSize.Should().Be(new Size(150, 50));
        }