When I run a Test Project on Visual Studio I use the code below to access a file inside the test project code folder
var Location = System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName
);
var FileLocation = Path.Combine(
Location
,@"..\..\..\TestProject1\App_Data\data.xml"
);
There is another (and better) way?