Skip to content

Commit c41530e

Browse files
committed
Update asserts
1 parent da0fa4c commit c41530e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

osu.Game.Rulesets.Osu.Tests/Editor/TestSliderScaling.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void TestScalingSliderFlat()
102102

103103
for (int i = 0; i < 100; i++)
104104
{
105-
Assert.True(Precision.AlmostEquals(sliderPathPerfect.PositionAt(i / 100.0f), sliderPathBezier.PositionAt(i / 100.0f)));
105+
Assert.That(Precision.AlmostEquals(sliderPathPerfect.PositionAt(i / 100.0f), sliderPathBezier.PositionAt(i / 100.0f)));
106106
}
107107
}
108108

@@ -174,7 +174,7 @@ private void assertMatchesPerfectCircle(SliderPath path)
174174
double theta = circularArcProperties.ThetaStart + (circularArcProperties.Direction * progress * circularArcProperties.ThetaRange);
175175
Vector2 vector = new Vector2((float)Math.Cos(theta), (float)Math.Sin(theta)) * circularArcProperties.Radius;
176176

177-
Assert.True(Precision.AlmostEquals(circularArcProperties.Centre + vector, path.PositionAt(progress), 0.01f),
177+
Assert.That(Precision.AlmostEquals(circularArcProperties.Centre + vector, path.PositionAt(progress), 0.01f),
178178
"A perfect circle with points " + string.Join(", ", path.ControlPoints.Select(x => x.Position)) + " and radius" + circularArcProperties.Radius + "from SliderPath does not almost equal a theoretical perfect circle with " + subpoints + " subpoints"
179179
+ ": " + (circularArcProperties.Centre + vector) + " - " + path.PositionAt(progress)
180180
+ " = " + (circularArcProperties.Centre + vector - path.PositionAt(progress))

osu.Game.Rulesets.Osu.Tests/StackingTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void TestStacking()
3131

3232
// The last hitobject triggers the stacking
3333
for (int i = 0; i < objects.Count - 1; i++)
34-
Assert.AreEqual(0, ((OsuHitObject)objects[i]).StackHeight);
34+
Assert.That(((OsuHitObject)objects[i]).StackHeight, Is.Zero);
3535
}
3636
}
3737

osu.Game/Tests/Beatmaps/BeatmapConversionTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private ConvertResult convert(string name, Mod[] mods)
133133

134134
string afterConversion = beatmap.Serialize();
135135

136-
Assert.AreEqual(beforeConversion, afterConversion, "Conversion altered original beatmap");
136+
Assert.That(afterConversion, Is.EqualTo(beforeConversion));
137137

138138
return new ConvertResult
139139
{

osu.Game/Tests/Beatmaps/LegacyModConversionTest.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ protected void TestFromLegacy(LegacyMods legacyMods, Type[] expectedMods)
2323
{
2424
var ruleset = CreateRuleset();
2525
var mods = ruleset.ConvertFromLegacyMods(legacyMods).ToList();
26-
Assert.AreEqual(expectedMods.Length, mods.Count);
26+
Assert.That(mods.Count, Is.EqualTo(expectedMods.Length));
2727

2828
foreach (var modType in expectedMods)
2929
{
30-
Assert.IsNotNull(mods.SingleOrDefault(mod => mod.GetType() == modType));
30+
Assert.That(mods.SingleOrDefault(mod => mod.GetType() == modType), Is.Not.Null);
3131
}
3232
}
3333

@@ -38,7 +38,7 @@ protected void TestToLegacy(LegacyMods expectedLegacyMods, Type[] providedModTyp
3838
.Where(mod => providedModTypes.Contains(mod.GetType()))
3939
.ToArray();
4040
var actualLegacyMods = ruleset.ConvertToLegacyMods(modInstances);
41-
Assert.AreEqual(expectedLegacyMods, actualLegacyMods);
41+
Assert.That(actualLegacyMods, Is.EqualTo(expectedLegacyMods));
4242
}
4343
}
4444
}

0 commit comments

Comments
 (0)