Change to fluent assertions

This commit is contained in:
smoogipoo
2021-04-27 22:38:37 +09:00
parent 1281993f1f
commit baa6e845aa

View File

@ -4,7 +4,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Utils;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Judgements;
@ -51,7 +50,7 @@ namespace osu.Game.Tests.Rulesets.Scoring
}; };
scoreProcessor.ApplyResult(judgementResult); scoreProcessor.ApplyResult(judgementResult);
Assert.IsTrue(Precision.AlmostEquals(expectedScore, scoreProcessor.TotalScore.Value)); Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(expectedScore).Within(0.5d));
} }
/// <summary> /// <summary>
@ -118,7 +117,7 @@ namespace osu.Game.Tests.Rulesets.Scoring
scoreProcessor.ApplyResult(judgementResult); scoreProcessor.ApplyResult(judgementResult);
} }
Assert.IsTrue(Precision.AlmostEquals(expectedScore, scoreProcessor.TotalScore.Value, 0.5)); Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(expectedScore).Within(0.5d));
} }
/// <remarks> /// <remarks>
@ -158,7 +157,7 @@ namespace osu.Game.Tests.Rulesets.Scoring
}; };
scoreProcessor.ApplyResult(lastJudgementResult); scoreProcessor.ApplyResult(lastJudgementResult);
Assert.IsTrue(Precision.AlmostEquals(expectedScore, scoreProcessor.TotalScore.Value, 0.5)); Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(expectedScore).Within(0.5d));
} }
[Test] [Test]
@ -169,7 +168,7 @@ namespace osu.Game.Tests.Rulesets.Scoring
scoreProcessor.Mode.Value = scoringMode; scoreProcessor.Mode.Value = scoringMode;
scoreProcessor.ApplyBeatmap(new TestBeatmap(new RulesetInfo())); scoreProcessor.ApplyBeatmap(new TestBeatmap(new RulesetInfo()));
Assert.IsTrue(Precision.AlmostEquals(0, scoreProcessor.TotalScore.Value)); Assert.That(scoreProcessor.TotalScore.Value, Is.Zero);
} }
[TestCase(HitResult.IgnoreHit, HitResult.IgnoreMiss)] [TestCase(HitResult.IgnoreHit, HitResult.IgnoreMiss)]