1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 04:13:00 +08:00

Fix path not being local enough for some unit tests.

This commit is contained in:
Dean Herbert 2016-10-25 00:27:47 +09:00
parent edb2eb1332
commit 6cc5407348
2 changed files with 5 additions and 4 deletions

View File

@ -8,10 +8,10 @@ namespace osu.Game.Tests.Resources
{
public static Stream OpenResource(string name)
{
return Assembly.GetExecutingAssembly().GetManifestResourceStream(
$@"osu.Game.Tests.Resources.{name}") ??
Assembly.LoadFrom("osu.Game.Resources.dll").GetManifestResourceStream(
$@"osu.Game.Resources.{name}");
var localPath = Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path));
return Assembly.GetExecutingAssembly().GetManifestResourceStream($@"osu.Game.Tests.Resources.{name}") ??
Assembly.LoadFrom(Path.Combine(localPath, @"osu.Game.Resources.dll")).GetManifestResourceStream($@"osu.Game.Resources.{name}");
}
}
}

View File

@ -35,6 +35,7 @@
<HintPath>..\packages\ppy.OpenTK.2.0.50727.1337\lib\net20\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
</ItemGroup>