Skip to content

Commit

Permalink
Follow the official PR to create the mod test scene.
Browse files Browse the repository at this point in the history
But scoring is not implemented, so mark the test scene ignore.

see:
https://github.com/ppy/osu/pull/26036/files
  • Loading branch information
andy840119 committed Dec 29, 2023
1 parent e3cf51c commit 0084f0e
Showing 1 changed file with 77 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Collections.Generic;
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Karaoke.Mods;
using osu.Game.Rulesets.Karaoke.Objects;
using osu.Game.Rulesets.Karaoke.Replays;
using osu.Game.Rulesets.Karaoke.Tests.Helper;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Replays;
using osu.Game.Tests.Visual;

namespace osu.Game.Rulesets.Karaoke.Tests.Mods;

[Ignore("Scoring is not implemented.")]
public partial class TestSceneKaraokeModSuddenDeath : ModFailConditionTestScene
{
protected override Ruleset CreatePlayerRuleset() => new KaraokeRuleset();

private readonly Lyric referencedLyric = TestCaseNoteHelper.CreateLyricForNote(1, "カラオケ", 1000, 1000);

public TestSceneKaraokeModSuddenDeath()
: base(new KaraokeModSuddenDeath())
{
}

[Test]
public void TestGreatHit() => CreateModTest(new ModTestData
{
Mod = new KaraokeModSuddenDeath(),
PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(false),
Autoplay = false,
Beatmap = new Beatmap
{
HitObjects = new List<HitObject>
{
referencedLyric,
new Note
{
ReferenceLyricId = referencedLyric.ID,
Tone = new Tone(0),
},
},
},
ReplayFrames = new List<ReplayFrame>
{
new KaraokeReplayFrame(1000, 0),
new KaraokeReplayFrame(2000, 0),
},
});

[Test]
public void TestBreakOnHoldNote() => CreateModTest(new ModTestData
{
Mod = new KaraokeModSuddenDeath(),
PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(true) && Player.Results.Count == 2,
Autoplay = false,
Beatmap = new Beatmap
{
HitObjects = new List<HitObject>
{
referencedLyric,
new Note
{
ReferenceLyricId = referencedLyric.ID,
Tone = new Tone(0),
},
},
},
ReplayFrames = new List<ReplayFrame>
{
new KaraokeReplayFrame(0, -1),
},
});
}

0 comments on commit 0084f0e

Please sign in to comment.