From f20a29603e88865a893b37de1fd6e2e6914b9dde Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Fri, 2 Nov 2018 10:20:25 -0700 Subject: [PATCH] Tests: copy test resources to output directory Copy the test resources to the output directory so that we can resolve the easily, instead of trying to resolve them from the source directory. --- LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj | 6 ++++++ LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj index 68ea2cfd0..77259ae1b 100644 --- a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj +++ b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj @@ -25,6 +25,12 @@ + + + PreserveNewest + + + <_TestAppFile Include="@(TestAppExe->'%(RootDir)%(Directory)%(Filename).exe')" /> diff --git a/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs b/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs index 762037637..595ef301f 100644 --- a/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs +++ b/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs @@ -63,9 +63,7 @@ private static void SetUpTestEnvironment() if (resourcesPath == null) { - string initialAssemblyParentFolder = Directory.GetParent(new Uri(typeof(BaseFixture).GetTypeInfo().Assembly.CodeBase).LocalPath).FullName; - int pos = initialAssemblyParentFolder.IndexOf("LibGit2Sharp.Tests"); - resourcesPath = Path.Combine(initialAssemblyParentFolder.Substring(0, pos), "../LibGit2Sharp.Tests/Resources"); + resourcesPath = Path.Combine(Directory.GetParent(new Uri(typeof(BaseFixture).GetTypeInfo().Assembly.CodeBase).LocalPath).FullName, "Resources"); } ResourcesDirectory = new DirectoryInfo(resourcesPath);