Example #1
0
        public void Draw_PreferredHeightOfAComponentChange_LayoutContainerIsTriggered()
        {
            var componentMock = new GraphicComponentMock { VerticalPolicy = ResizePolicy.Preferred };
            var container = CreateContainer(componentMock);

            componentMock.RaisePreferredSizeChanged();
            container.Draw();

            layoutMock.Verify(l => l.LayoutContainer(container), Times.Once);
        }
        public void PreferredHeight_ComponentsPreferredHeightChanged_EqualsContentsNewPreferredHeight()
        {
            var arrowMock = new GraphicComponentMock();
            var contentMock = new GraphicComponentMock();
            var container = CreateContainer(arrowMock, contentMock);

            contentMock.PreferredHeight = 10;
            contentMock.RaisePreferredSizeChanged();

            Assert.AreEqual(10, container.PreferredHeight, 10e-9);
        }