Skip to content

Commit

Permalink
reorder LadderEditorScreen tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ILW8 committed Jul 20, 2023
1 parent 3510394 commit 8cd8168
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions osu.Game.Tournament.Tests/Screens/TestSceneLadderEditorScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void Setup() => Schedule(() =>
});

[Test]
public void TestResetBracketTeams()
public void TestResetBracketTeamsCancelled()
{
AddStep("pull up context menu", () =>
{
Expand All @@ -49,25 +49,22 @@ public void TestResetBracketTeams()
});

AddAssert("dialog displayed", () => dialogOverlay.CurrentDialog is LadderResetTeamsDialog);

AddStep("click confirmation", () =>
AddStep("click cancel", () =>
{
InputManager.MoveMouseTo(dialogOverlay.CurrentDialog.ChildrenOfType<PopupDialogButton>().First());
InputManager.PressButton(MouseButton.Left);
InputManager.MoveMouseTo(dialogOverlay.CurrentDialog.ChildrenOfType<PopupDialogButton>().Last());
InputManager.Click(MouseButton.Left);
});

AddUntilStep("dialog dismissed", () => dialogOverlay.CurrentDialog is not LadderResetTeamsDialog);

AddStep("release mouse button", () => InputManager.ReleaseButton(MouseButton.Left));

AddAssert("assert ladder teams reset", () =>
AddAssert("assert ladder teams unchanged", () =>
{
return Ladder.Matches.All(m => m.Team1.Value == null && m.Team2.Value == null);
return !Ladder.Matches.Any(m => m.Team1.Value == null && m.Team2.Value == null);
});
}

[Test]
public void TestResetBracketTeamsCancelled()
public void TestResetBracketTeams()
{
AddStep("pull up context menu", () =>
{
Expand All @@ -83,17 +80,20 @@ public void TestResetBracketTeamsCancelled()
});

AddAssert("dialog displayed", () => dialogOverlay.CurrentDialog is LadderResetTeamsDialog);
AddStep("click cancel", () =>

AddStep("click confirmation", () =>
{
InputManager.MoveMouseTo(dialogOverlay.CurrentDialog.ChildrenOfType<PopupDialogButton>().Last());
InputManager.Click(MouseButton.Left);
InputManager.MoveMouseTo(dialogOverlay.CurrentDialog.ChildrenOfType<PopupDialogButton>().First());
InputManager.PressButton(MouseButton.Left);
});

AddUntilStep("dialog dismissed", () => dialogOverlay.CurrentDialog is not LadderResetTeamsDialog);

AddAssert("assert ladder teams unchanged", () =>
AddStep("release mouse button", () => InputManager.ReleaseButton(MouseButton.Left));

AddAssert("assert ladder teams reset", () =>
{
return !Ladder.Matches.Any(m => m.Team1.Value == null && m.Team2.Value == null);
return Ladder.Matches.All(m => m.Team1.Value == null && m.Team2.Value == null);
});
}
}
Expand Down

0 comments on commit 8cd8168

Please sign in to comment.