mirror of
https://github.com/ppy/osu
synced 2025-01-25 23:32:58 +00:00
Fix TestSceneTopLocalRank
This commit is contained in:
parent
4d14467d95
commit
73544231de
@ -179,7 +179,7 @@ namespace osu.Game.Tests.Resources
|
|||||||
BeatmapHash = beatmap.Hash,
|
BeatmapHash = beatmap.Hash,
|
||||||
Ruleset = beatmap.Ruleset,
|
Ruleset = beatmap.Ruleset,
|
||||||
Mods = new Mod[] { new TestModHardRock(), new TestModDoubleTime() },
|
Mods = new Mod[] { new TestModHardRock(), new TestModDoubleTime() },
|
||||||
TotalScore = 2845370,
|
TotalScore = 284537,
|
||||||
Accuracy = 0.95,
|
Accuracy = 0.95,
|
||||||
MaxCombo = 999,
|
MaxCombo = 999,
|
||||||
Position = 1,
|
Position = 1,
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -12,7 +11,6 @@ using osu.Framework.Platform;
|
|||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Screens.Select.Carousel;
|
using osu.Game.Screens.Select.Carousel;
|
||||||
using osu.Game.Tests.Resources;
|
using osu.Game.Tests.Resources;
|
||||||
@ -143,25 +141,20 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
testScoreInfo.User = API.LocalUser.Value;
|
testScoreInfo.User = API.LocalUser.Value;
|
||||||
testScoreInfo.Rank = ScoreRank.B;
|
testScoreInfo.Rank = ScoreRank.B;
|
||||||
testScoreInfo.TotalScore = scoreManager.GetTotalScore(testScoreInfo, ScoringMode.Classic);
|
|
||||||
|
|
||||||
scoreManager.Import(testScoreInfo);
|
scoreManager.Import(testScoreInfo);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("B rank displayed", () => topLocalRank.DisplayedRank == ScoreRank.B);
|
AddUntilStep("B rank displayed", () => topLocalRank.DisplayedRank == ScoreRank.B);
|
||||||
|
|
||||||
AddStep("Add higher score for current user", () =>
|
AddStep("Add higher-graded score for current user", () =>
|
||||||
{
|
{
|
||||||
var testScoreInfo2 = TestResources.CreateTestScoreInfo(importedBeatmap);
|
var testScoreInfo2 = TestResources.CreateTestScoreInfo(importedBeatmap);
|
||||||
|
|
||||||
testScoreInfo2.User = API.LocalUser.Value;
|
testScoreInfo2.User = API.LocalUser.Value;
|
||||||
testScoreInfo2.Rank = ScoreRank.X;
|
testScoreInfo2.Rank = ScoreRank.X;
|
||||||
testScoreInfo2.Statistics = testScoreInfo2.MaximumStatistics;
|
testScoreInfo2.Statistics = testScoreInfo2.MaximumStatistics;
|
||||||
testScoreInfo2.TotalScore = scoreManager.GetTotalScore(testScoreInfo2);
|
testScoreInfo2.TotalScore = testScoreInfo.TotalScore + 1;
|
||||||
|
|
||||||
// ensure second score has a total score (standardised) less than first one (classic)
|
|
||||||
// despite having better statistics, otherwise this test is pointless.
|
|
||||||
Debug.Assert(testScoreInfo2.TotalScore < testScoreInfo.TotalScore);
|
|
||||||
|
|
||||||
scoreManager.Import(testScoreInfo2);
|
scoreManager.Import(testScoreInfo2);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user