mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09: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:
@ -83,7 +83,7 @@ namespace osu.Game.Tests.Editing.Checks
|
|||||||
|
|
||||||
private BeatmapVerifierContext getContext(string resourceName, bool allowMissing = false)
|
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)
|
if (!allowMissing && resourceStream == null)
|
||||||
throw new FileNotFoundException($"The requested test resource \"{resourceName}\" does not exist.");
|
throw new FileNotFoundException($"The requested test resource \"{resourceName}\" does not exist.");
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ namespace osu.Game.Tests.Editing.Checks
|
|||||||
|
|
||||||
private BeatmapVerifierContext getContext(string resourceName, bool allowMissing = false)
|
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)
|
if (!allowMissing && resourceStream == null)
|
||||||
throw new FileNotFoundException($"The requested test resource \"{resourceName}\" does not exist.");
|
throw new FileNotFoundException($"The requested test resource \"{resourceName}\" does not exist.");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user