Пример #1
0
        public void TestChangePositionInvalidatesMiscGeometryOnSelf()
        {
            TestBox1 box = null;

            AddStep("create test", () =>
            {
                Child = box = new TestBox1
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre
                };
            });

            AddUntilStep("wait for validation", () => box.MiscGeometryLayoutValue.IsValid);

            AddAssert("change position and ensure MiscGeometry invalidated on self", () =>
            {
                box.Position = new Vector2(50);
                return(!box.MiscGeometryLayoutValue.IsValid);
            });
        }
        public void TestContainerAutoSizeUpdatesWhenChildBecomesDeadWithoutRemoval()
        {
            Box       box    = null;
            Container parent = null;

            AddStep("create test", () =>
            {
                Child = parent = new Container
                {
                    RemoveCompletedTransforms = false,
                    AutoSizeAxes = Axes.Both,
                    Child        = box = new TestBox1 {
                        Size = new Vector2(200)
                    }
                };
            });

            AddStep("make child dead", () => box.Expire());

            AddAssert("parent has size 0", () => Precision.AlmostEquals(Vector2.Zero, parent.DrawSize));
        }
Пример #3
0
        public void TestChangeSizeInvalidatesDrawSizeOnSelf()
        {
            TestBox1 box = null;

            AddStep("create test", () =>
            {
                Child = box = new TestBox1
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Size   = new Vector2(50)
                };
            });

            AddUntilStep("wait for validation", () => box.DrawSizeLayoutValue.IsValid);

            AddAssert("change size and ensure DrawSize invalidated on self", () =>
            {
                box.Size = new Vector2(100);
                return(!box.DrawSizeLayoutValue.IsValid);
            });
        }