1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-30 10:02:54 +08:00
osu-lazer/osu.Game.Rulesets.Taiko.Tests/TestSceneTaikoSuddenDeath.cs

54 lines
1.6 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2022-06-17 15:37:17 +08:00
#nullable disable
using System.Linq;
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Taiko.Beatmaps;
using osu.Game.Rulesets.Taiko.Mods;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Tests.Visual;
namespace osu.Game.Rulesets.Taiko.Tests
{
2022-11-24 13:32:20 +08:00
public partial class TestSceneTaikoSuddenDeath : TestSceneTaikoPlayer
{
protected override bool AllowFail => true;
protected override TestPlayer CreatePlayer(Ruleset ruleset)
{
2019-12-13 20:45:38 +08:00
SelectedMods.Value = SelectedMods.Value.Concat(new[] { new TaikoModSuddenDeath() }).ToArray();
return base.CreatePlayer(ruleset);
}
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) =>
new TaikoBeatmap
{
HitObjects =
{
new Swell { StartTime = 1500 },
new Hit { StartTime = 100000 },
},
BeatmapInfo =
{
Ruleset = new TaikoRuleset().RulesetInfo
}
};
[Test]
public void TestSwellDoesNotFail()
{
bool judged = false;
AddStep("Setup judgements", () =>
{
judged = false;
2022-06-24 20:25:23 +08:00
Player.ScoreProcessor.NewJudgement += _ => judged = true;
});
AddUntilStep("swell judged", () => judged);
AddAssert("not failed", () => !Player.GameplayState.HasFailed);
}
}
}