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:
parent
d4779f06cf
commit
bb9cbd3e66
@ -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.");
|
||||
|
||||
|
@ -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.");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user