1
0
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:
Bartłomiej Dach
2025-02-07 08:21:34 +01:00
Unverified
parent 4d1167fdcc
commit a49b1b61b4
@@ -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()
{