public void square() { var size = LayoutSize.Square(30); size.IsFixedAspectRatio().Should().BeFalse(); size.IsMeasurableAlong(Orientation.Horizontal).Should().BeTrue(); size.IsMeasurableAlong(Orientation.Vertical).Should().BeTrue(); size.IsStretchedAlong(Orientation.Vertical).Should().BeFalse(); size.IsStretchedPerpendicular(Orientation.Vertical).Should().BeFalse(); }
public void create_window_test() { var headerHeight = 8; var layout = LayoutNode.VerticalParent("root", LayoutSize.Pixels(80, 40), LayoutStyle.Empty, LayoutNode.HorizontalParent("header", LayoutSize.StretchedHorizontally(headerHeight), new LayoutStyle(padding: 2), LayoutNode.StretchedSpacer(), LayoutNode.Leaf("minimize", LayoutSize.Square(headerHeight)), LayoutNode.Leaf("fullscreen", LayoutSize.Square(headerHeight)), LayoutNode.Leaf("close", LayoutSize.Square(headerHeight)) ), LayoutNode.Leaf("canvas", LayoutSize.StretchedBoth()) ); var firstBakeResult = layout.Bake(); Approvals.Verify(LayoutNodeUtils.DrawResult(firstBakeResult)); }