示例#1
0
        public void flex_can_specify_a_min_width()
        {
            var layout = FlexLayout.HorizontalFlexParent("root", new FlexLayoutStyle(minAlongSize: 100, style: new LayoutStyle(margin: new Point(5, 5), padding: 3, alignment: Alignment.BottomCenter)),
                                                         LayoutNode.Leaf("itemA", LayoutSize.Pixels(10, 3)),
                                                         LayoutNode.Leaf("itemB", LayoutSize.Pixels(12, 10)),
                                                         LayoutNode.Leaf("itemC", LayoutSize.Pixels(8, 5)),
                                                         LayoutNode.Leaf("itemD", LayoutSize.Pixels(9, 10)),
                                                         LayoutNode.Leaf("itemE", LayoutSize.Pixels(7, 8))
                                                         );

            var result = layout.Bake();

            Approvals.Verify(LayoutNodeUtils.DrawResult(result));
        }
示例#2
0
        public void flex_layout_supports_padding()
        {
            var layout = FlexLayout.HorizontalFlexParent("root", new FlexLayoutStyle(style: new LayoutStyle(margin: new Point(5, 5), padding: 3)),
                                                         LayoutNode.Leaf("itemA", LayoutSize.Pixels(10, 3)),
                                                         LayoutNode.Leaf("itemB", LayoutSize.Pixels(12, 10)),
                                                         LayoutNode.Leaf("itemC", LayoutSize.Pixels(8, 5)),
                                                         LayoutNode.Leaf("itemD", LayoutSize.Pixels(9, 10)),
                                                         LayoutNode.Leaf("itemE", LayoutSize.Pixels(7, 8))
                                                         );

            var result = layout.Bake();

            Approvals.Verify(LayoutNodeUtils.DrawResult(result));
        }
示例#3
0
        public void flex_considers_alignment_when_things_have_varied_perpendicular_size()
        {
            var layout = FlexLayout.HorizontalFlexParent("root", new FlexLayoutStyle(style: new LayoutStyle(margin: new Point(5, 5), padding: 3, alignment: Alignment.BottomCenter)),
                                                         LayoutNode.Leaf("itemA", LayoutSize.Pixels(10, 3)),
                                                         LayoutNode.Leaf("itemB", LayoutSize.Pixels(12, 10)),
                                                         LayoutNode.Leaf("itemC", LayoutSize.Pixels(8, 5)),
                                                         LayoutNode.Leaf("itemD", LayoutSize.Pixels(9, 10)),
                                                         LayoutNode.Leaf("itemE", LayoutSize.Pixels(7, 8))
                                                         );

            var result = layout.Bake();

            Approvals.Verify(LayoutNodeUtils.DrawResult(result));
        }
示例#4
0
        public void can_create_flex_layout()
        {
            var layout = FlexLayout.HorizontalFlexParent("root", FlexLayoutStyle.Empty,
                                                         LayoutNode.Leaf("itemA", LayoutSize.Pixels(10, 3)),
                                                         LayoutNode.Leaf("itemB", LayoutSize.Pixels(12, 10)),
                                                         LayoutNode.Leaf("itemC", LayoutSize.Pixels(8, 5)),
                                                         LayoutNode.Leaf("itemD", LayoutSize.Pixels(9, 10)),
                                                         LayoutNode.Leaf("itemE", LayoutSize.Pixels(7, 8))
                                                         );

            var result = layout.Bake();

            Approvals.Verify(LayoutNodeUtils.DrawResult(result));
        }