Esempio n. 1
0
        public void DistributeSpaceVertical_Default()
        {
            MockApplication app = MockApplication.Setup <FlexVertical_DistributeSpaceVertical>();
            FlexVertical_DistributeSpaceVertical root = (FlexVertical_DistributeSpaceVertical)app.RootElement;

            app.Update();

            Assert.AreEqual(new Rect(0, 0, 500, 100), root[0].layoutResult.AllocatedRect);
            Assert.AreEqual(new Rect(0, 100, 500, 100), root[1].layoutResult.AllocatedRect);
            Assert.AreEqual(new Rect(0, 200, 500, 100), root[2].layoutResult.AllocatedRect);
        }
Esempio n. 2
0
        public void DistributeSpaceVertical_BeforeContent()
        {
            MockApplication app = MockApplication.Setup <FlexVertical_DistributeSpaceVertical>();
            FlexVertical_DistributeSpaceVertical root = (FlexVertical_DistributeSpaceVertical)app.RootElement;

            root.style.SetDistributeExtraSpaceVertical(SpaceDistribution.BeforeContent, StyleState.Normal);
            app.Update();

            Assert.AreEqual(new Rect(0, 200, 500, 100), root[0].layoutResult.AllocatedRect);
            Assert.AreEqual(new Rect(0, 300, 500, 100), root[1].layoutResult.AllocatedRect);
            Assert.AreEqual(new Rect(0, 400, 500, 100), root[2].layoutResult.AllocatedRect);
        }
Esempio n. 3
0
        public void DistributeSpaceVertical_AroundContent()
        {
            MockApplication app = MockApplication.Setup <FlexVertical_DistributeSpaceVertical>();
            FlexVertical_DistributeSpaceVertical root = (FlexVertical_DistributeSpaceVertical)app.RootElement;

            // makes math cleaner
            root.style.SetPreferredHeight(600f, StyleState.Normal);
            root.style.SetDistributeExtraSpaceVertical(SpaceDistribution.AroundContent, StyleState.Normal);

            app.Update();

            Assert.AreEqual(new Rect(0, 50, 500, 100), root[0].layoutResult.AllocatedRect);
            Assert.AreEqual(new Rect(0, 250, 500, 100), root[1].layoutResult.AllocatedRect);
            Assert.AreEqual(new Rect(0, 450, 500, 100), root[2].layoutResult.AllocatedRect);
        }