Created
June 19, 2012 19:55
-
-
Save jchadwick/2956175 to your computer and use it in GitHub Desktop.
Get Project path for VS Test Runner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Yeah, this is crazy, right? Stupid Visual Studio test runner... | |
var testPathReplacer = new System.Text.RegularExpressions.Regex(@"\\(?:(TestResults\\[^\\]*\\Out)|([^\\]*\\bin\\[^\\]*))"); | |
var assemblyDirectory = Path.GetDirectoryName(GetType().Assembly.Location); | |
assemblyDirectory = testPathReplacer.Replace(assemblyDirectory, string.Empty); | |
assemblyDirectory = Path.Combine(assemblyDirectory, PROJECT_DIRECTORY); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment