1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-08 06:52:59 +08:00

Update test expectations

This commit is contained in:
Dean Herbert 2023-12-20 19:57:42 +09:00
parent e0c27510f2
commit d417b156b2
No known key found for this signature in database
3 changed files with 9 additions and 8 deletions

View File

@ -3,6 +3,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Utils;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mania.Mods; using osu.Game.Rulesets.Mania.Mods;
using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects;
@ -25,8 +26,8 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods
public void TestHitWindowWithoutDoubleTime() => CreateModTest(new ModTestData public void TestHitWindowWithoutDoubleTime() => CreateModTest(new ModTestData
{ {
PassCondition = () => Player.ScoreProcessor.JudgedHits > 0 PassCondition = () => Player.ScoreProcessor.JudgedHits > 0
&& Player.ScoreProcessor.Accuracy.Value == 1 && Precision.AlmostEquals(Player.ScoreProcessor.Accuracy.Value, 0.9836, 0.01)
&& Player.ScoreProcessor.TotalScore.Value == 1_000_000, && Player.ScoreProcessor.TotalScore.Value == 946_049,
Autoplay = false, Autoplay = false,
Beatmap = new Beatmap Beatmap = new Beatmap
{ {
@ -53,7 +54,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods
Mod = doubleTime, Mod = doubleTime,
PassCondition = () => Player.ScoreProcessor.JudgedHits > 0 PassCondition = () => Player.ScoreProcessor.JudgedHits > 0
&& Player.ScoreProcessor.Accuracy.Value == 1 && Player.ScoreProcessor.Accuracy.Value == 1
&& Player.ScoreProcessor.TotalScore.Value == (long)(1_000_010 * doubleTime.ScoreMultiplier), && Player.ScoreProcessor.TotalScore.Value == (long)(1_000_000 * doubleTime.ScoreMultiplier),
Autoplay = false, Autoplay = false,
Beatmap = new Beatmap Beatmap = new Beatmap
{ {

View File

@ -201,11 +201,11 @@ namespace osu.Game.Rulesets.Mania.Tests
assertHeadJudgement(HitResult.Perfect); assertHeadJudgement(HitResult.Perfect);
// judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult. // judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult.
assertComboAtJudgement(1, 1); assertComboAtJudgement(0, 1);
assertTailJudgement(HitResult.Meh); assertTailJudgement(HitResult.Meh);
assertComboAtJudgement(2, 0); assertComboAtJudgement(1, 0);
// judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult. // judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult.
assertComboAtJudgement(4, 1); assertComboAtJudgement(3, 1);
} }
/// <summary> /// <summary>

View File

@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Mania.Tests
AddAssert("all objects perfectly judged", AddAssert("all objects perfectly judged",
() => judgementResults.Select(result => result.Type), () => judgementResults.Select(result => result.Type),
() => Is.EquivalentTo(judgementResults.Select(result => result.Judgement.MaxResult))); () => Is.EquivalentTo(judgementResults.Select(result => result.Judgement.MaxResult)));
AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_030)); AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_000));
} }
[Test] [Test]
@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Mania.Tests
AddAssert("all objects perfectly judged", AddAssert("all objects perfectly judged",
() => judgementResults.Select(result => result.Type), () => judgementResults.Select(result => result.Type),
() => Is.EquivalentTo(judgementResults.Select(result => result.Judgement.MaxResult))); () => Is.EquivalentTo(judgementResults.Select(result => result.Judgement.MaxResult)));
AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_040)); AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_000));
} }
private void performTest(List<ManiaHitObject> hitObjects, List<ReplayFrame> frames) private void performTest(List<ManiaHitObject> hitObjects, List<ReplayFrame> frames)