mirror of
https://github.com/osukey/osukey.git
synced 2025-05-22 05:57:35 +09: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
|
public class TestSceneScorePanel : OsuTestScene
|
||||||
{
|
{
|
||||||
|
private ScorePanel panel;
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDRank()
|
public void TestDRank()
|
||||||
{
|
{
|
||||||
@ -84,9 +86,24 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
addPanelStep(score, PanelState.Contracted);
|
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", () =>
|
private void addPanelStep(ScoreInfo score, PanelState state = PanelState.Expanded) => AddStep("add panel", () =>
|
||||||
{
|
{
|
||||||
Child = new ScorePanel(score)
|
Child = panel = new ScorePanel(score)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user