Add test coverage for filter handling in classic style

This commit is contained in:
Bartłomiej Dach 2022-06-21 15:00:39 +02:00
parent da1814e7c3
commit a996325e19
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -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)