I'm building a new application with EF4. The EF code is in it's own assembly along with the repository code. I'm trying to do some unit testing with Visual Studio's MSTest, but I'm have trouble getting started. My code is -
string s = "metadata=res://*/DataModels.MonitorUrlEf.csdl|res://*/DataModels.MonitorUrlEf.ssdl|res://*/DataModels.MonitorUrlEf.msl;provider=System.Data.SqlClient;provider connection string=\"Data Source=TOM-VAIO;Initial Catalog=WebMonDb4;Integrated Security=True;Pooling=False;MultipleActiveResultSets=True\"";
var DbContext = new WebMonDb4Entities(s);
WebMonDb4Entities
is the EF Context created by the EF designer. I'm putting the connection string in a variable so I don't have to deal with the issues of where the connection files are during the testing. The contents of the string are copied from the app.config file in the project where the EF designer code is.
The error is "Unable to load the specified metadata resource." I've done some research and this should work. Any suggestions?