mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Wrap Content into a container for animating visibility.
This commit is contained in:
@ -30,8 +30,6 @@ namespace osu.Game.Tests.Visual.Online
|
||||
|
||||
private class TestOnlineViewContainer : OnlineViewContainer
|
||||
{
|
||||
public new Container<Drawable> Content => base.Content;
|
||||
|
||||
public new LoadingAnimation LoadingAnimation => base.LoadingAnimation;
|
||||
|
||||
public TestOnlineViewContainer()
|
||||
@ -54,6 +52,10 @@ namespace osu.Game.Tests.Visual.Online
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected override void FadeContentOut(Drawable content) => content.Hide();
|
||||
|
||||
protected override void FadeContentIn(Drawable content) => content.Show();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -61,7 +63,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
AddStep("set status to online", () => ((DummyAPIAccess)API).State = APIState.Online);
|
||||
|
||||
AddAssert("children are visible", () => onlineView.Content.IsPresent);
|
||||
AddAssert("children are visible", () => onlineView.TransformationTarget.IsPresent);
|
||||
AddAssert("loading animation is not visible", () => !onlineView.LoadingAnimation.IsPresent);
|
||||
}
|
||||
|
||||
@ -70,7 +72,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
AddStep("set status to offline", () => ((DummyAPIAccess)API).State = APIState.Offline);
|
||||
|
||||
AddAssert("children are hidden", () => !onlineView.Content.IsPresent);
|
||||
AddAssert("children are hidden", () => !onlineView.TransformationTarget.IsPresent);
|
||||
AddAssert("loading animation is not visible", () => !onlineView.LoadingAnimation.IsPresent);
|
||||
}
|
||||
|
||||
@ -79,12 +81,12 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
AddStep("set status to connecting", () => ((DummyAPIAccess)API).State = APIState.Connecting);
|
||||
|
||||
AddAssert("children are hidden", () => !onlineView.Content.IsPresent);
|
||||
AddAssert("children are hidden", () => !onlineView.TransformationTarget.IsPresent);
|
||||
AddAssert("loading animation is visible", () => onlineView.LoadingAnimation.IsPresent);
|
||||
|
||||
AddStep("set status to failing", () => ((DummyAPIAccess)API).State = APIState.Failing);
|
||||
|
||||
AddAssert("children are hidden", () => !onlineView.Content.IsPresent);
|
||||
AddAssert("children are hidden", () => !onlineView.TransformationTarget.IsPresent);
|
||||
AddAssert("loading animation is visible", () => onlineView.LoadingAnimation.IsPresent);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user