mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Add tests
This commit is contained in:
parent
142a67e163
commit
bda3cdc9a7
@ -821,5 +821,47 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestUndefinedApproachRateInheritsOverallDifficulty()
|
||||
{
|
||||
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
||||
|
||||
using (var resStream = TestResources.OpenResource("undefined-approach-rate.osu"))
|
||||
using (var stream = new LineBufferedReader(resStream))
|
||||
{
|
||||
var decoded = decoder.Decode(stream);
|
||||
Assert.That(decoded.Difficulty.ApproachRate, Is.EqualTo(1));
|
||||
Assert.That(decoded.Difficulty.OverallDifficulty, Is.EqualTo(1));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestApproachRateDefinedBeforeOverallDifficulty()
|
||||
{
|
||||
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
||||
|
||||
using (var resStream = TestResources.OpenResource("approach-rate-before-overall-difficulty.osu"))
|
||||
using (var stream = new LineBufferedReader(resStream))
|
||||
{
|
||||
var decoded = decoder.Decode(stream);
|
||||
Assert.That(decoded.Difficulty.ApproachRate, Is.EqualTo(9));
|
||||
Assert.That(decoded.Difficulty.OverallDifficulty, Is.EqualTo(1));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestApproachRateDefinedAfterOverallDifficulty()
|
||||
{
|
||||
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
||||
|
||||
using (var resStream = TestResources.OpenResource("approach-rate-after-overall-difficulty.osu"))
|
||||
using (var stream = new LineBufferedReader(resStream))
|
||||
{
|
||||
var decoded = decoder.Decode(stream);
|
||||
Assert.That(decoded.Difficulty.ApproachRate, Is.EqualTo(9));
|
||||
Assert.That(decoded.Difficulty.OverallDifficulty, Is.EqualTo(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,3 @@
|
||||
[Difficulty]
|
||||
OverallDifficulty:1
|
||||
ApproachRate:9
|
@ -0,0 +1,3 @@
|
||||
[Difficulty]
|
||||
ApproachRate:9
|
||||
OverallDifficulty:1
|
2
osu.Game.Tests/Resources/undefined-approach-rate.osu
Normal file
2
osu.Game.Tests/Resources/undefined-approach-rate.osu
Normal file
@ -0,0 +1,2 @@
|
||||
[Difficulty]
|
||||
OverallDifficulty:1
|
Loading…
Reference in New Issue
Block a user