1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:33:20 +08:00

Add extra test coverage for breaks before first/after last object

This commit is contained in:
Bartłomiej Dach 2023-07-22 17:12:35 +02:00
parent 699b66be42
commit 2df6e91176
No known key found for this signature in database

View File

@ -88,6 +88,52 @@ namespace osu.Game.Tests.Editing.Checks
Assert.That(issues.Single().Template is CheckBreaks.IssueTemplateLateEnd);
}
[Test]
public void TestBreakAfterLastObjectStartsEarly()
{
var beatmap = new Beatmap<HitObject>
{
HitObjects =
{
new HitCircle { StartTime = 0 },
new HitCircle { StartTime = 1200 }
},
Breaks = new List<BreakPeriod>
{
new BreakPeriod(1398, 2300)
}
};
var context = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap));
var issues = check.Run(context).ToList();
Assert.That(issues, Has.Count.EqualTo(1));
Assert.That(issues.Single().Template is CheckBreaks.IssueTemplateEarlyStart);
}
[Test]
public void TestBreakBeforeFirstObjectEndsLate()
{
var beatmap = new Beatmap<HitObject>
{
HitObjects =
{
new HitCircle { StartTime = 1100 },
new HitCircle { StartTime = 1500 }
},
Breaks = new List<BreakPeriod>
{
new BreakPeriod(0, 652)
}
};
var context = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap));
var issues = check.Run(context).ToList();
Assert.That(issues, Has.Count.EqualTo(1));
Assert.That(issues.Single().Template is CheckBreaks.IssueTemplateLateEnd);
}
[Test]
public void TestBreakMultipleObjectsEarly()
{