mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Rewrite assertions to use nunit constraints
This commit is contained in:
parent
c9f611a713
commit
ab4d47b594
@ -381,13 +381,13 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
private void addJudgementAssert(string name, Func<OsuHitObject?> hitObject, HitResult result)
|
||||
{
|
||||
AddAssert($"{name} judgement is {result}",
|
||||
() => judgementResults.Single(r => r.HitObject == hitObject()).Type == result);
|
||||
() => judgementResults.Single(r => r.HitObject == hitObject()).Type, () => Is.EqualTo(result));
|
||||
}
|
||||
|
||||
private void addJudgementOffsetAssert(OsuHitObject hitObject, double offset)
|
||||
{
|
||||
AddAssert($"({hitObject.GetType().ReadableName()} @ {hitObject.StartTime}) judged at {offset}",
|
||||
() => Precision.AlmostEquals(judgementResults.Single(r => r.HitObject == hitObject).TimeOffset, offset, 100));
|
||||
() => judgementResults.Single(r => r.HitObject == hitObject).TimeOffset, () => Is.EqualTo(offset).Within(100));
|
||||
}
|
||||
|
||||
private ScoreAccessibleReplayPlayer currentPlayer = null!;
|
||||
|
Loading…
Reference in New Issue
Block a user