mirror of https://github.com/ppy/osu
Add test
This commit is contained in:
parent
8de62b608e
commit
620c2311ac
|
@ -18,8 +18,24 @@ protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
|
int fireCount = 0;
|
||||||
|
|
||||||
Add(overlay = new TestFullscreenOverlay());
|
Add(overlay = new TestFullscreenOverlay());
|
||||||
AddStep(@"toggle", overlay.ToggleVisibility);
|
|
||||||
|
overlay.State.ValueChanged += _ => fireCount++;
|
||||||
|
|
||||||
|
AddStep(@"show", overlay.Show);
|
||||||
|
|
||||||
|
AddAssert("fire count 1", () => fireCount == 1);
|
||||||
|
|
||||||
|
AddStep(@"show again", overlay.Show);
|
||||||
|
|
||||||
|
// this logic is specific to FullscreenOverlay
|
||||||
|
AddAssert("fire count 2", () => fireCount == 2);
|
||||||
|
|
||||||
|
AddStep(@"hide", overlay.Hide);
|
||||||
|
|
||||||
|
AddAssert("fire count 3", () => fireCount == 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestFullscreenOverlay : FullscreenOverlay
|
private class TestFullscreenOverlay : FullscreenOverlay
|
||||||
|
|
Loading…
Reference in New Issue