mirror of
https://github.com/ppy/osu
synced 2025-01-28 08:43:05 +00:00
Remove unnecessary queue in beatmap difficulty cache tests
This commit is contained in:
parent
48e5199c58
commit
4d9c415e73
@ -32,7 +32,6 @@ namespace osu.Game.Tests.Beatmaps
|
||||
private TestBeatmapDifficultyCache difficultyCache;
|
||||
|
||||
private IBindable<StarDifficulty?> starDifficultyBindable;
|
||||
private Queue<ValueChangedEvent<StarDifficulty?>> starDifficultyChangesQueue;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGameBase osu)
|
||||
@ -49,14 +48,10 @@ namespace osu.Game.Tests.Beatmaps
|
||||
|
||||
Child = difficultyCache = new TestBeatmapDifficultyCache();
|
||||
|
||||
starDifficultyChangesQueue = new Queue<ValueChangedEvent<StarDifficulty?>>();
|
||||
starDifficultyBindable = difficultyCache.GetBindableDifficulty(importedSet.Beatmaps.First());
|
||||
starDifficultyBindable.BindValueChanged(starDifficultyChangesQueue.Enqueue);
|
||||
});
|
||||
|
||||
AddAssert($"star difficulty -> {BASE_STARS}", () =>
|
||||
starDifficultyChangesQueue.Dequeue().NewValue?.Stars == BASE_STARS &&
|
||||
starDifficultyChangesQueue.Count == 0);
|
||||
AddAssert($"star difficulty -> {BASE_STARS}", () => starDifficultyBindable.Value?.Stars == BASE_STARS);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -65,19 +60,13 @@ namespace osu.Game.Tests.Beatmaps
|
||||
OsuModDoubleTime dt = null;
|
||||
|
||||
AddStep("change selected mod to DT", () => SelectedMods.Value = new[] { dt = new OsuModDoubleTime { SpeedChange = { Value = 1.5 } } });
|
||||
AddAssert($"star difficulty -> {BASE_STARS + 1.5}", () =>
|
||||
starDifficultyChangesQueue.Dequeue().NewValue?.Stars == BASE_STARS + 1.5 &&
|
||||
starDifficultyChangesQueue.Count == 0);
|
||||
AddAssert($"star difficulty -> {BASE_STARS + 1.5}", () => starDifficultyBindable.Value?.Stars == BASE_STARS + 1.5);
|
||||
|
||||
AddStep("change DT speed to 1.25", () => dt.SpeedChange.Value = 1.25);
|
||||
AddAssert($"star difficulty -> {BASE_STARS + 1.25}", () =>
|
||||
starDifficultyChangesQueue.Dequeue().NewValue?.Stars == BASE_STARS + 1.25 &&
|
||||
starDifficultyChangesQueue.Count == 0);
|
||||
AddAssert($"star difficulty -> {BASE_STARS + 1.25}", () => starDifficultyBindable.Value?.Stars == BASE_STARS + 1.25);
|
||||
|
||||
AddStep("change selected mod to NC", () => SelectedMods.Value = new[] { new OsuModNightcore { SpeedChange = { Value = 1.75 } } });
|
||||
AddAssert($"star difficulty -> {BASE_STARS + 1.75}", () =>
|
||||
starDifficultyChangesQueue.Dequeue().NewValue?.Stars == BASE_STARS + 1.75 &&
|
||||
starDifficultyChangesQueue.Count == 0);
|
||||
AddAssert($"star difficulty -> {BASE_STARS + 1.75}", () => starDifficultyBindable.Value?.Stars == BASE_STARS + 1.75);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
Loading…
Reference in New Issue
Block a user