Exemple #1
0
        public void Arrange_should_arrange_inner_component(string contentAlignment, string clipMargin, string expectedInnerLayout, string expectedViewRegion)
        {
            var viewport = new Viewport
            {
                Width            = 30,
                Height           = 30,
                ClipMargin       = Spacer.Parse(clipMargin),
                Inner            = new FixedMeasureComponent(100, 200),
                ContentAlignment = Alignment.Parse(contentAlignment)
            };

            viewport.Measure(new Size(int.MaxValue, int.MaxValue), TestRendererContext.Instance);

            viewport.Arrange(new Rectangle(1, 2, 30, 30));
            viewport.Inner.Layout.ShouldBe(RectParser.ToRect(expectedInnerLayout));
            viewport.ActualViewRegion.ShouldBe(RectParser.ToRect(expectedViewRegion));
        }