mirror of
https://github.com/ppy/osu
synced 2024-12-17 20:35:21 +00:00
Add test coverage for filter handling in classic style
This commit is contained in:
parent
da1814e7c3
commit
a996325e19
@ -226,6 +226,11 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
AddStep("press J", () => InputManager.Key(Key.J));
|
AddStep("press J", () => InputManager.Key(Key.J));
|
||||||
AddAssert("no change", () => this.ChildrenOfType<ModPanel>().Single(panel => panel.Active.Value).Mod.Acronym == "NC");
|
AddAssert("no change", () => this.ChildrenOfType<ModPanel>().Single(panel => panel.Active.Value).Mod.Acronym == "NC");
|
||||||
|
|
||||||
|
AddStep("filter everything but NC", () => setFilter(mod => mod.Acronym == "NC"));
|
||||||
|
|
||||||
|
AddStep("press A", () => InputManager.Key(Key.A));
|
||||||
|
AddAssert("no change", () => this.ChildrenOfType<ModPanel>().Single(panel => panel.Active.Value).Mod.Acronym == "NC");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -273,6 +278,11 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
AddStep("press J", () => InputManager.Key(Key.J));
|
AddStep("press J", () => InputManager.Key(Key.J));
|
||||||
AddAssert("no change", () => this.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
AddAssert("no change", () => this.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
||||||
|
|
||||||
|
AddStep("filter everything but NC", () => setFilter(mod => mod.Acronym == "NC"));
|
||||||
|
|
||||||
|
AddStep("press A", () => InputManager.Key(Key.A));
|
||||||
|
AddAssert("no change", () => this.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setFilter(Func<Mod, bool>? filter)
|
private void setFilter(Func<Mod, bool>? filter)
|
||||||
|
Loading…
Reference in New Issue
Block a user