public void TestStartHiddenNested(bool startHidden, bool immediatelyVisible) { TestNestedVisibilityContainer visibility = null; AddStep("create container", () => { Child = testContainer = visibility = new TestNestedVisibilityContainer(startHidden) { State = { Value = immediatelyVisible ? Visibility.Visible : Visibility.Hidden } }; if (!immediatelyVisible) { testContainer.Show(); } }); checkVisible(!startHidden); AddAssert("box has transforms", () => visibility.BoxHasTransforms); AddStep("hide", () => testContainer.Hide()); checkHidden(); AddAssert("box doesn't have transforms", () => !visibility.BoxHasTransforms); AddAssert("fire count is 2", () => testContainer.FireCount == 2); }
public void TestNotStartHiddenButHidden() { AddStep("create container", () => Child = testContainer = new TestVisibilityContainer(false) { State = { Value = Visibility.Hidden } }); AddAssert("alpha above zero", () => testContainer.Alpha > 0); checkHidden(false); }
public void TestShowHide() { AddStep("create container", () => Child = testContainer = new TestVisibilityContainer()); checkHidden(true); AddStep("show", () => testContainer.Show()); checkVisible(); AddStep("hide", () => testContainer.Hide()); checkHidden(); AddAssert("fire count is 2", () => testContainer.FireCount == 2); }
public TestNestedVisibilityContainer(bool startHidden = true) : base(startHidden) { Add(nested = new TestVisibilityContainer(true, Color4.Yellow)); nested.Add(box = new Box { Colour = Color4.Black, RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(0.5f), }); }
public void TestStartHidden(bool startHidden) { AddStep("create container", () => Child = testContainer = new TestVisibilityContainer(startHidden) { State = { Value = Visibility.Visible } }); checkVisible(!startHidden); AddStep("hide", () => testContainer.Hide()); checkHidden(); AddAssert("fire count is 2", () => testContainer.FireCount == 2); }
public void TestShowInCtor() { AddStep("create container", () => { var container = new TestVisibilityContainer(null); container.Show(); var containingContainer = new Container { RelativeSizeAxes = Axes.Both, Child = testContainer = container }; containingContainer.OnLoadComplete += _ => testContainer.Hide(); Child = containingContainer; }); checkHidden(); }