Skip to content

Instantly share code, notes, and snippets.

@SlyNet
Created June 15, 2011 14:00
Show Gist options
  • Save SlyNet/1027162 to your computer and use it in GitHub Desktop.
Save SlyNet/1027162 to your computer and use it in GitHub Desktop.
public static bool IsUnitTest
{
get
{
FileInfo fileInfo = new FileInfo(Process.GetCurrentProcess().MainModule.FileName);
return fileInfo.Name.StartsWith("vstesthost", StringComparison.OrdinalIgnoreCase) || fileInfo.Name.StartsWith("mstest", StringComparison.OrdinalIgnoreCase);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment