From 6cc54073480f0458e91304468e8631d68f6528fe Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Oct 2016 00:27:47 +0900 Subject: [PATCH] Fix path not being local enough for some unit tests. --- osu.Game.Tests/Resources/Resource.cs | 8 ++++---- osu.Game.Tests/osu.Game.Tests.csproj | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Resources/Resource.cs b/osu.Game.Tests/Resources/Resource.cs index 910268adbf..21945ac504 100644 --- a/osu.Game.Tests/Resources/Resource.cs +++ b/osu.Game.Tests/Resources/Resource.cs @@ -8,10 +8,10 @@ public static class Resource { 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}"); } } } \ No newline at end of file diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 8a63fdea7a..264eabd85c 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -35,6 +35,7 @@ ..\packages\ppy.OpenTK.2.0.50727.1337\lib\net20\OpenTK.dll True +