Update tests

This commit is contained in:
Dean Herbert 2019-11-21 15:56:08 +09:00
parent 8369be90f2
commit 586e31efc2
1 changed files with 3 additions and 4 deletions

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.MathUtils;
using osu.Game.Beatmaps;
using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Osu;
@ -22,9 +23,7 @@ public void TestShortLeadIn()
BeatmapInfo = { AudioLeadIn = 1000 }
});
AddUntilStep("player loaded", () => player.IsLoaded && player.Alpha == 1);
AddAssert("correct lead-in", () => player.FirstFrameClockTime == 0);
AddAssert("correct lead-in", () => Precision.AlmostEquals(player.FirstFrameClockTime.Value, 0, 100));
}
[Test]
@ -35,7 +34,7 @@ public void TestLongLeadIn()
BeatmapInfo = { AudioLeadIn = 10000 }
});
AddAssert("correct lead-in", () => player.FirstFrameClockTime == player.GameplayStartTime - 10000);
AddAssert("correct lead-in", () => Precision.AlmostEquals(player.FirstFrameClockTime.Value, player.GameplayStartTime - 10000, 100));
}
private void loadPlayerWithBeatmap(IBeatmap beatmap)