Skip to content

Commit 8e129e5

Browse files
authored
Merge pull request #1630 from lupino3/fix-test-path
Fix resources path computation in test setup
2 parents cc56296 + 356d77b commit 8e129e5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ private static void SetUpTestEnvironment()
6464
if (resourcesPath == null)
6565
{
6666
string initialAssemblyParentFolder = Directory.GetParent(new Uri(typeof(BaseFixture).GetTypeInfo().Assembly.CodeBase).LocalPath).FullName;
67-
const string sourceRelativePath = @"../../../../LibGit2Sharp.Tests/Resources";
68-
69-
resourcesPath = Path.Combine(initialAssemblyParentFolder, sourceRelativePath);
67+
int pos = initialAssemblyParentFolder.IndexOf("LibGit2Sharp.Tests");
68+
resourcesPath = Path.Combine(initialAssemblyParentFolder.Substring(0, pos), "../LibGit2Sharp.Tests/Resources");
7069
}
7170

7271
ResourcesDirectory = new DirectoryInfo(resourcesPath);

0 commit comments

Comments
 (0)