Just assert doesn't throw and don't catch at LegacyDecoder

This commit is contained in:
David Zhao
2019-08-07 19:25:40 +09:00
parent da15e19912
commit 15a592e25e
3 changed files with 3 additions and 28 deletions

View File

@ -484,20 +484,14 @@ namespace osu.Game.Tests.Beatmaps.Formats
}
[Test]
public void TestDecodeInvalidEvents()
public void TestInvalidEventStillPasses()
{
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
using (var goodResStream = TestResources.OpenResource("valid-events.osu"))
using (var goodStream = new StreamReader(goodResStream))
using (var badResStream = TestResources.OpenResource("invalid-events.osu"))
using (var badStream = new StreamReader(badResStream))
{
var goodBeatmap = decoder.Decode(goodStream);
var badBeatmap = decoder.Decode(badStream);
Assert.AreEqual(goodBeatmap.Breaks[0].Duration, badBeatmap.Breaks[0].Duration);
Assert.AreEqual(goodBeatmap.Metadata.BackgroundFile, badBeatmap.Metadata.BackgroundFile);
Assert.DoesNotThrow(() => decoder.Decode(badStream));
}
}
}