1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-18 13:20:32 +08:00

Add failing test case

This commit is contained in:
Bartłomiej Dach
2025-05-19 14:14:48 +02:00
Unverified
parent 6a56ed1d3b
commit b60cf08635
@@ -65,5 +65,61 @@ namespace osu.Game.Rulesets.Mania.Tests
AddStep(@"exit player", () => currentPlayer.Exit());
}
[Test]
public void TestCorrectComboAccountingForConcurrentObjects()
{
Score score = null!;
var beatmap = new ManiaBeatmap(new StageDefinition(4))
{
HitObjects =
{
new Note
{
StartTime = 500,
Column = 0,
},
new Note
{
StartTime = 500,
Column = 2,
},
new HoldNote
{
StartTime = 1000,
EndTime = 1500,
Column = 1,
}
}
};
AddStep(@"create replay", () => score = new Score
{
Replay = new Replay
{
Frames =
{
new ManiaReplayFrame(500, ManiaAction.Key1, ManiaAction.Key3),
new ManiaReplayFrame(520),
new ManiaReplayFrame(1000, ManiaAction.Key2),
new ManiaReplayFrame(1500),
}
},
ScoreInfo = new ScoreInfo()
});
AddStep(@"set beatmap", () => Beatmap.Value = CreateWorkingBeatmap(beatmap));
AddStep(@"set ruleset", () => Ruleset.Value = beatmap.BeatmapInfo.Ruleset);
AddStep(@"push player", () => LoadScreen(currentPlayer = new ReplayPlayer(score)));
AddUntilStep(@"wait until player is loaded", () => currentPlayer.IsCurrentScreen());
AddUntilStep(@"wait for objects to be judged", () => currentPlayer.ChildrenOfType<IFrameStableClock>().Single().CurrentTime, () => Is.GreaterThan(1600));
AddStep(@"stop gameplay", () => currentPlayer.ChildrenOfType<GameplayClockContainer>().Single().Stop());
AddStep(@"seek to start", () => currentPlayer.Seek(0));
AddAssert(@"combo is 0", () => currentPlayer.GameplayState.ScoreProcessor.Combo.Value, () => Is.Zero);
AddStep(@"exit player", () => currentPlayer.Exit());
}
}
}