예제 #1
0
        public void Arrange()
        {
            var style = LayoutTestStyle.Create();
            var b     = new Notebook(style);

            style.StyleResolver.AddRoot(b);
            b.Tabs.Add(new NotebookTab(style, new Label(style, "Tab 1"), null));
            b.Tabs.Add(new NotebookTab(style, new Label(style, "Tab 2"), null));
            b.Tabs.Add(new NotebookTab(style, new Label(style, "Tab 3"), null));

            b.Arrange(new Rectangle(10, 20, 400, 300));
            b.LayoutRect.Should().Be(new Rectangle(10, 20, 400, 300));
            b.Tabs.LayoutRect.Should().Be(new Rectangle(10, 20, 400, 35));
            b.Tabs[0].LayoutRect.Should().Be(new Rectangle(30, 20, 155, 35));
            b.Tabs[1].LayoutRect.Should().Be(new Rectangle(170, 20, 155, 35));
            b.Tabs[2].LayoutRect.Should().Be(new Rectangle(310, 20, 155, 35));
        }