mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 03:22:54 +08:00
Reorder tests for testability
This commit is contained in:
parent
654a7057fc
commit
6ef39b87fe
@ -69,6 +69,30 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestCase(1, ScoreRank.X)]
|
||||||
|
[TestCase(0.9999, ScoreRank.S)]
|
||||||
|
[TestCase(0.975, ScoreRank.S)]
|
||||||
|
[TestCase(0.925, ScoreRank.A)]
|
||||||
|
[TestCase(0.85, ScoreRank.B)]
|
||||||
|
[TestCase(0.75, ScoreRank.C)]
|
||||||
|
[TestCase(0.5, ScoreRank.D)]
|
||||||
|
[TestCase(0.2, ScoreRank.D)]
|
||||||
|
public void TestResultsWithPlayer(double accuracy, ScoreRank rank)
|
||||||
|
{
|
||||||
|
TestResultsScreen screen = null;
|
||||||
|
|
||||||
|
var score = TestResources.CreateTestScoreInfo();
|
||||||
|
|
||||||
|
score.OnlineID = 1234;
|
||||||
|
score.HitEvents = TestSceneStatisticsPanel.CreatePositionDistributedHitEvents();
|
||||||
|
score.Accuracy = accuracy;
|
||||||
|
score.Rank = rank;
|
||||||
|
|
||||||
|
loadResultsScreen(() => screen = createResultsScreen(score));
|
||||||
|
AddUntilStep("wait for loaded", () => screen.IsLoaded);
|
||||||
|
AddAssert("retry overlay present", () => screen.RetryOverlay != null);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestResultsWithoutPlayer()
|
public void TestResultsWithoutPlayer()
|
||||||
{
|
{
|
||||||
@ -83,8 +107,6 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
};
|
};
|
||||||
|
|
||||||
var score = TestResources.CreateTestScoreInfo();
|
var score = TestResources.CreateTestScoreInfo();
|
||||||
score.OnlineID = 1234;
|
|
||||||
score.HitEvents = TestSceneStatisticsPanel.CreatePositionDistributedHitEvents();
|
|
||||||
|
|
||||||
stack.Push(screen = createResultsScreen(score));
|
stack.Push(screen = createResultsScreen(score));
|
||||||
});
|
});
|
||||||
@ -92,28 +114,6 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
AddAssert("retry overlay not present", () => screen.RetryOverlay == null);
|
AddAssert("retry overlay not present", () => screen.RetryOverlay == null);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase(0.2, ScoreRank.D)]
|
|
||||||
[TestCase(0.5, ScoreRank.D)]
|
|
||||||
[TestCase(0.75, ScoreRank.C)]
|
|
||||||
[TestCase(0.85, ScoreRank.B)]
|
|
||||||
[TestCase(0.925, ScoreRank.A)]
|
|
||||||
[TestCase(0.975, ScoreRank.S)]
|
|
||||||
[TestCase(0.9999, ScoreRank.S)]
|
|
||||||
[TestCase(1, ScoreRank.X)]
|
|
||||||
public void TestResultsWithPlayer(double accuracy, ScoreRank rank)
|
|
||||||
{
|
|
||||||
TestResultsScreen screen = null;
|
|
||||||
|
|
||||||
var score = TestResources.CreateTestScoreInfo();
|
|
||||||
|
|
||||||
score.Accuracy = accuracy;
|
|
||||||
score.Rank = rank;
|
|
||||||
|
|
||||||
loadResultsScreen(() => screen = createResultsScreen(score));
|
|
||||||
AddUntilStep("wait for loaded", () => screen.IsLoaded);
|
|
||||||
AddAssert("retry overlay present", () => screen.RetryOverlay != null);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestResultsForUnranked()
|
public void TestResultsForUnranked()
|
||||||
{
|
{
|
||||||
@ -332,13 +332,14 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private partial class TestResultsScreen : ResultsScreen
|
private partial class TestResultsScreen : SoloResultsScreen
|
||||||
{
|
{
|
||||||
public HotkeyRetryOverlay RetryOverlay;
|
public HotkeyRetryOverlay RetryOverlay;
|
||||||
|
|
||||||
public TestResultsScreen(ScoreInfo score)
|
public TestResultsScreen(ScoreInfo score)
|
||||||
: base(score, true)
|
: base(score, true)
|
||||||
{
|
{
|
||||||
|
ShowUserStatistics = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
Loading…
Reference in New Issue
Block a user