mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 11:42:56 +08:00
Add expansion/contraction test
This commit is contained in:
parent
906a317a3d
commit
a1ece4f308
@ -12,6 +12,8 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
{
|
||||
public class TestSceneScorePanel : OsuTestScene
|
||||
{
|
||||
private ScorePanel panel;
|
||||
|
||||
[Test]
|
||||
public void TestDRank()
|
||||
{
|
||||
@ -84,9 +86,24 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
addPanelStep(score, PanelState.Contracted);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestExpandAndContract()
|
||||
{
|
||||
var score = new TestScoreInfo(new OsuRuleset().RulesetInfo) { Accuracy = 0.925, Rank = ScoreRank.A };
|
||||
|
||||
addPanelStep(score, PanelState.Contracted);
|
||||
AddWaitStep("wait for transition", 10);
|
||||
|
||||
AddStep("expand panel", () => panel.State = PanelState.Expanded);
|
||||
AddWaitStep("wait for transition", 10);
|
||||
|
||||
AddStep("contract panel", () => panel.State = PanelState.Contracted);
|
||||
AddWaitStep("wait for transition", 10);
|
||||
}
|
||||
|
||||
private void addPanelStep(ScoreInfo score, PanelState state = PanelState.Expanded) => AddStep("add panel", () =>
|
||||
{
|
||||
Child = new ScorePanel(score)
|
||||
Child = panel = new ScorePanel(score)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
Loading…
Reference in New Issue
Block a user