Add failing test case

This commit is contained in:
Bartłomiej Dach 2020-08-15 13:06:53 +02:00
parent f2bc16f4bd
commit c1a9bf507a
1 changed files with 14 additions and 0 deletions

View File

@ -272,7 +272,21 @@ public void TestEnterKeySelection()
AddAssert("Overlay is closed", () => pauseOverlay.State.Value == Visibility.Hidden);
}
[Test]
public void TestSelectionResetOnVisibilityChange()
{
showOverlay();
AddStep("Select last button", () => InputManager.Key(Key.Up));
hideOverlay();
showOverlay();
AddAssert("No button selected",
() => pauseOverlay.Buttons.All(button => !button.Selected.Value));
}
private void showOverlay() => AddStep("Show overlay", () => pauseOverlay.Show());
private void hideOverlay() => AddStep("Hide overlay", () => pauseOverlay.Hide());
private DialogButton getButton(int index) => pauseOverlay.Buttons.Skip(index).First();