Add test coverage of getting last object time

This commit is contained in:
Dean Herbert 2022-12-01 18:04:04 +09:00
parent 896f2d8f74
commit d9d48516fc
2 changed files with 57 additions and 0 deletions

View File

@ -314,6 +314,24 @@ public void TestDecodeBeatmapColours()
}
}
[Test]
public void TestGetLastObjectTime()
{
var decoder = new LegacyBeatmapDecoder();
using (var resStream = TestResources.OpenResource("mania-last-object-not-latest.osu"))
using (var stream = new LineBufferedReader(resStream))
{
var beatmap = decoder.Decode(stream);
Assert.That(beatmap.HitObjects.Last().StartTime, Is.EqualTo(2494));
Assert.That(beatmap.HitObjects.Last().GetEndTime(), Is.EqualTo(2494));
Assert.That(beatmap.HitObjects.Max(h => h.GetEndTime()), Is.EqualTo(2582));
Assert.That(beatmap.GetLastObjectTime(), Is.EqualTo(2582));
}
}
[Test]
public void TestDecodeBeatmapComboOffsetsOsu()
{

View File

@ -0,0 +1,39 @@
osu file format v14
[General]
SampleSet: Normal
StackLeniency: 0.7
Mode: 3
[Difficulty]
HPDrainRate:3
CircleSize:5
OverallDifficulty:8
ApproachRate:8
SliderMultiplier:3.59999990463257
SliderTickRate:2
[TimingPoints]
24,352.941176470588,4,1,1,100,1,0
6376,-50,4,1,1,100,0,0
[HitObjects]
51,192,24,1,0,0:0:0:0:
153,192,200,1,0,0:0:0:0:
358,192,376,1,0,0:0:0:0:
460,192,553,1,0,0:0:0:0:
460,192,729,128,0,1435:0:0:0:0:
358,192,906,128,0,1612:0:0:0:0:
256,192,1082,128,0,1788:0:0:0:0:
153,192,1259,128,0,1965:0:0:0:0:
51,192,1435,128,0,2141:0:0:0:0:
51,192,2318,1,12,0:0:0:0:
153,192,2318,1,4,0:0:0:0:
256,192,2318,1,6,0:0:0:0:
358,192,2318,1,14,0:0:0:0:
460,192,2318,1,0,0:0:0:0:
51,192,2494,128,0,2582:0:0:0:0:
153,192,2494,128,14,2582:0:0:0:0:
256,192,2494,128,6,2582:0:0:0:0:
358,192,2494,128,4,2582:0:0:0:0:
460,192,2494,1,12,0:0:0:0:0: