reorder LadderEditorScreen tests

This commit is contained in:
Dao Heng Liu 2023-07-17 08:11:28 +01:00
parent 3510394699
commit 8cd81681b2
1 changed files with 31 additions and 31 deletions

View File

@ -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<DrawableOsuMenuItem>().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<PopupDialogButton>().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<DrawableOsuMenuItem>().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<PopupDialogButton>().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);
});
}
}
}