diff --git a/osu.Game.Tournament.Tests/Screens/TestSceneLadderEditorScreen.cs b/osu.Game.Tournament.Tests/Screens/TestSceneLadderEditorScreen.cs index 825a976309..1bcf6334ec 100644 --- a/osu.Game.Tournament.Tests/Screens/TestSceneLadderEditorScreen.cs +++ b/osu.Game.Tournament.Tests/Screens/TestSceneLadderEditorScreen.cs @@ -32,6 +32,37 @@ public void Setup() => Schedule(() => }); }); + [Test] + public void TestResetBracketTeamsCancelled() + { + AddStep("pull up context menu", () => + { + InputManager.MoveMouseTo(ladderEditorScreen); + InputManager.Click(MouseButton.Right); + }); + + AddStep("click Reset teams button", () => + { + InputManager.MoveMouseTo(osuContextMenuContainer.ChildrenOfType().Last(p => + ((OsuMenuItem)p.Item).Type == MenuItemType.Destructive), new Vector2(5, 0)); + InputManager.Click(MouseButton.Left); + }); + + AddAssert("dialog displayed", () => dialogOverlay.CurrentDialog is LadderResetTeamsDialog); + AddStep("click cancel", () => + { + InputManager.MoveMouseTo(dialogOverlay.CurrentDialog.ChildrenOfType().Last()); + InputManager.Click(MouseButton.Left); + }); + + AddUntilStep("dialog dismissed", () => dialogOverlay.CurrentDialog is not LadderResetTeamsDialog); + + AddAssert("assert ladder teams unchanged", () => + { + return !Ladder.Matches.Any(m => m.Team1.Value == null && m.Team2.Value == null); + }); + } + [Test] public void TestResetBracketTeams() { @@ -65,36 +96,5 @@ public void TestResetBracketTeams() return Ladder.Matches.All(m => m.Team1.Value == null && m.Team2.Value == null); }); } - - [Test] - public void TestResetBracketTeamsCancelled() - { - AddStep("pull up context menu", () => - { - InputManager.MoveMouseTo(ladderEditorScreen); - InputManager.Click(MouseButton.Right); - }); - - AddStep("click Reset teams button", () => - { - InputManager.MoveMouseTo(osuContextMenuContainer.ChildrenOfType().Last(p => - ((OsuMenuItem)p.Item).Type == MenuItemType.Destructive), new Vector2(5, 0)); - InputManager.Click(MouseButton.Left); - }); - - AddAssert("dialog displayed", () => dialogOverlay.CurrentDialog is LadderResetTeamsDialog); - AddStep("click cancel", () => - { - InputManager.MoveMouseTo(dialogOverlay.CurrentDialog.ChildrenOfType().Last()); - InputManager.Click(MouseButton.Left); - }); - - AddUntilStep("dialog dismissed", () => dialogOverlay.CurrentDialog is not LadderResetTeamsDialog); - - AddAssert("assert ladder teams unchanged", () => - { - return !Ladder.Matches.Any(m => m.Team1.Value == null && m.Team2.Value == null); - }); - } } }