Fix test failures due to early disposal of import stream

This commit is contained in:
Dean Herbert 2024-11-12 21:08:06 +09:00
parent ce86208e09
commit 48212dfaeb
No known key found for this signature in database

View File

@ -40,15 +40,13 @@ namespace osu.Game.Tests.Visual.Online
AddStep("import score", () =>
{
using (var resourceStream = TestResources.OpenResource("Replays/mania-replay.osr"))
{
var importTask = new ImportTask(resourceStream, "replay.osr");
var resourceStream = TestResources.OpenResource("Replays/mania-replay.osr");
var importTask = new ImportTask(resourceStream, "replay.osr");
Game.ScoreManager.Import(new[] { importTask });
}
Game.ScoreManager.Import(new[] { importTask });
});
AddUntilStep("Replay missing notification show", () => Game.Notifications.ChildrenOfType<MissingBeatmapNotification>().Any());
AddUntilStep("Replay missing notification shown", () => Game.Notifications.ChildrenOfType<MissingBeatmapNotification>().Any());
}
[Test]
@ -58,15 +56,13 @@ namespace osu.Game.Tests.Visual.Online
AddStep("import score", () =>
{
using (var resourceStream = TestResources.OpenResource("Replays/mania-replay.osr"))
{
var importTask = new ImportTask(resourceStream, "replay.osr");
var resourceStream = TestResources.OpenResource("Replays/mania-replay.osr");
var importTask = new ImportTask(resourceStream, "replay.osr");
Game.ScoreManager.Import(new[] { importTask });
}
Game.ScoreManager.Import(new[] { importTask });
});
AddUntilStep("Replay missing notification not show", () => !Game.Notifications.ChildrenOfType<MissingBeatmapNotification>().Any());
AddUntilStep("Replay missing notification not shown", () => !Game.Notifications.ChildrenOfType<MissingBeatmapNotification>().Any());
}
private void setupBeatmapResponse(APIBeatmap b)