mirror of
https://github.com/ppy/osu.git
synced 2026-05-27 14:50:45 +08:00
Add test coverage for scores with zero total not submitting
This commit is contained in:
@@ -16,6 +16,7 @@ using osu.Game.Online.API;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Online.Solo;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Mania;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
@@ -234,6 +235,31 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddAssert("ensure no submission", () => Player.SubmittedScore == null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestNoSubmissionWhenScoreZero()
|
||||
{
|
||||
prepareTestAPI(true);
|
||||
|
||||
createPlayerTest();
|
||||
|
||||
AddUntilStep("wait for token request", () => Player.TokenCreationRequested);
|
||||
|
||||
AddUntilStep("wait for track to start running", () => Beatmap.Value.Track.IsRunning);
|
||||
AddUntilStep("wait for first result", () => Player.Results.Count > 0);
|
||||
|
||||
AddStep("add fake non-scoring hit", () =>
|
||||
{
|
||||
Player.ScoreProcessor.RevertResult(Player.Results.First());
|
||||
Player.ScoreProcessor.ApplyResult(new OsuJudgementResult(Beatmap.Value.Beatmap.HitObjects.First(), new IgnoreJudgement())
|
||||
{
|
||||
Type = HitResult.IgnoreHit,
|
||||
});
|
||||
});
|
||||
|
||||
AddStep("exit", () => Player.Exit());
|
||||
AddAssert("ensure no submission", () => Player.SubmittedScore == null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSubmissionOnExit()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user