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
1 changed files with 10 additions and 0 deletions

View File

@ -226,6 +226,11 @@ public void TestClassicKeyboardExclusiveSelection()
AddStep("press J", () => InputManager.Key(Key.J));
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]
@ -273,6 +278,11 @@ public void TestClassicKeyboardIncompatibleSelection()
AddStep("press J", () => InputManager.Key(Key.J));
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)