If a test framework has loaded a shadow copy of your test assembly, and you need the path it was built to, you can use the following:

           
var codebase = new Uri(Assembly.GetExecutingAssembly().CodeBase);
var assembly = new FileInfo(codebase.LocalPath);