1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:17:51 +08:00

Add test coverage

This commit is contained in:
Bartłomiej Dach 2022-06-24 13:43:02 +02:00
parent 3497e966fd
commit 09768cd740
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -0,0 +1,80 @@
// 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.
using System.Collections.Generic;
using NUnit.Framework;
using osu.Game.Rulesets.Replays;
using osu.Game.Rulesets.Taiko.Beatmaps;
using osu.Game.Rulesets.Taiko.Mods;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Rulesets.Taiko.Replays;
namespace osu.Game.Rulesets.Taiko.Tests.Mods
{
public class TestSceneTaikoModClassic : TaikoModTestScene
{
[Test]
public void TestHittingDrumRollsIsOptional() => CreateModTest(new ModTestData
{
Mod = new TaikoModClassic(),
Autoplay = false,
Beatmap = new TaikoBeatmap
{
BeatmapInfo = { Ruleset = CreatePlayerRuleset().RulesetInfo },
HitObjects = new List<TaikoHitObject>
{
new Hit
{
StartTime = 1000,
Type = HitType.Centre
},
new DrumRoll
{
StartTime = 3000,
EndTime = 6000
}
}
},
ReplayFrames = new List<ReplayFrame>
{
new TaikoReplayFrame(1000, TaikoAction.LeftCentre),
new TaikoReplayFrame(1001)
},
PassCondition = () => Player.ScoreProcessor.HasCompleted.Value
&& Player.ScoreProcessor.Combo.Value == 1
&& Player.ScoreProcessor.Accuracy.Value == 1
});
[Test]
public void TestHittingSwellsIsOptional() => CreateModTest(new ModTestData
{
Mod = new TaikoModClassic(),
Autoplay = false,
Beatmap = new TaikoBeatmap
{
BeatmapInfo = { Ruleset = CreatePlayerRuleset().RulesetInfo },
HitObjects = new List<TaikoHitObject>
{
new Hit
{
StartTime = 1000,
Type = HitType.Centre
},
new Swell
{
StartTime = 3000,
EndTime = 6000
}
}
},
ReplayFrames = new List<ReplayFrame>
{
new TaikoReplayFrame(1000, TaikoAction.LeftCentre),
new TaikoReplayFrame(1001)
},
PassCondition = () => Player.ScoreProcessor.HasCompleted.Value
&& Player.ScoreProcessor.Combo.Value == 1
&& Player.ScoreProcessor.Accuracy.Value == 1
});
}
}