1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Undo disposal of Stream for use in mocking

Because the Stream object is accessed when the mocked object calls `GetStream`, we cannot close it here.

The resource should be released upon teardown anyway.
This commit is contained in:
Naxesss 2021-10-12 00:35:58 +02:00
parent d4779f06cf
commit bb9cbd3e66
2 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ namespace osu.Game.Tests.Editing.Checks
private BeatmapVerifierContext getContext(string resourceName, bool allowMissing = false)
{
using Stream resourceStream = string.IsNullOrEmpty(resourceName) ? null : TestResources.OpenResource(resourceName);
Stream resourceStream = string.IsNullOrEmpty(resourceName) ? null : TestResources.OpenResource(resourceName);
if (!allowMissing && resourceStream == null)
throw new FileNotFoundException($"The requested test resource \"{resourceName}\" does not exist.");

View File

@ -104,7 +104,7 @@ namespace osu.Game.Tests.Editing.Checks
private BeatmapVerifierContext getContext(string resourceName, bool allowMissing = false)
{
using Stream resourceStream = string.IsNullOrEmpty(resourceName) ? null : TestResources.OpenResource(resourceName);
Stream resourceStream = string.IsNullOrEmpty(resourceName) ? null : TestResources.OpenResource(resourceName);
if (!allowMissing && resourceStream == null)
throw new FileNotFoundException($"The requested test resource \"{resourceName}\" does not exist.");