Hi Terry,
Sorry, I think I have misunderstood your problem.
NCrunch has no knowledge of databases or of the workings of your source code. It does not manipulate connection strings or anything around how your code connects to the database. Your code is basically just code that is executed under test. There is a line of code in NCrunch that explicitly sets the DataDirectory AppDomain variable to be the working directory of the executing test, it does so in this way:
AppDomain.CurrentDomain.SetData("DataDirectory", <working directory>);
This was added because some people make use of the DataDirectory appdomain value which is automatically set by MSTest. This value is automatically placed into connection strings during connection by ADO.NET, so if for some reason this value is different to that which is normally set by MSTest, then your code will be unable to find the database.
The .mdf file is just a file, treated like NCrunch the same as any other file. Because the file is being shared between tests, you should definitely look into making use of ExclusivelyUsesAttribute if you are using parallel execution for your database tests.
But anyway, the key question here is whether or not the database resource file is being referenced in the place that it exists in the NCrunch workspace.
Try adding the following two lines to your test code, then inspecting the results in the test output:
Console.WriteLine(AppDomain.CurrentDomain.GetData("DataDirectory") + @"\Resources\MdmTestDb.mdf");
Console.WriteLine(System.IO.File.Exists(AppDomain.CurrentDomain.GetData("DataDirectory") + @"\Resources\MdmTestDb.mdf"));
This will tell us whether or not the file is in its expected location in NCrunch's workspace. If you can let me know what the results are from the above two lines, I can help with further troubleshooting.
Cheers,
Remco