net451 build issue
This commit is contained in:
parent
84f10f58e9
commit
3c2459afa2
1 changed files with 13 additions and 8 deletions
|
@ -93,21 +93,26 @@ namespace Microsoft.DotNet.TestFramework
|
|||
throw new Exception($"Cannot find '{testProjectName}' at '{AssetsRoot}'");
|
||||
}
|
||||
|
||||
#if NET451
|
||||
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
#else
|
||||
string baseDirectory = AppContext.BaseDirectory;
|
||||
#endif
|
||||
string testDestination = Path.Combine(baseDirectory, callingMethod + identifier, testProjectName);
|
||||
var testDestination = GetTestDestinationDirectoryPath(testProjectName, callingMethod, identifier);
|
||||
var testInstance = new TestInstance(testProjectDir, testDestination);
|
||||
return testInstance;
|
||||
}
|
||||
|
||||
public TestDirectory CreateTestDirectory([CallerMemberName] string callingMethod = "", string identifier = "")
|
||||
{
|
||||
string testDestination = Path.Combine(AppContext.BaseDirectory, callingMethod + identifier);
|
||||
|
||||
var testDestination = GetTestDestinationDirectoryPath(string.Empty, callingMethod, identifier);
|
||||
|
||||
return new TestDirectory(testDestination);
|
||||
}
|
||||
|
||||
private string GetTestDestinationDirectoryPath(string testProjectName, string callingMethod, string identifier)
|
||||
{
|
||||
#if NET451
|
||||
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
#else
|
||||
string baseDirectory = AppContext.BaseDirectory;
|
||||
#endif
|
||||
return Path.Combine(baseDirectory, callingMethod + identifier, testProjectName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue