|
I'm trying to test my model in a unit test suite. For obvious reasons, I don't actually care about persistence... just that the operations occur against the local cache (which is automatically discarded when I dispose the context object, right?).
The problem is... I can't figure out what the connection string for this use-case should be? Before constructing the container/context I've tried pre-configuring DevForce this way:
string modelKey = "DirectoryServiceContainer"; string modelName = "DirectoryService"; string modelAssembly = "Halliburton.PEToolkit.DataServices.Directory.Model.dll"; var connectionString = string.Format("metadata={0}\\{1}.csdl|{0}\\{1}.ssdl|{0}\\{1}.msl", modelAssembly, modelName); EdmKeyElement edmKey = new EdmKeyElement(); edmKey.Name = modelKey; edmKey.Connection = connectionString; IdeaBladeConfig.Instance.EdmKeys.Add(edmKey);
Note that this application has *no* app.config... it's just a unit test assembly. I'm relying on the unit test framework to pre-configure the environment.
I've verified with a custom IDataSourceKeyResolver that the correct key is getting retrieved (by manually constructing a DefaultKeyResolver inside GetKey() and inspecting and logging the resulting ClientEdmKey). The error seems to be that the connection string is not valid. This is the actual connection string after string formatting:
container/context I've tried pre-configuring DevForce this way:
metadata=Halliburton.PEToolkit.DataServices.Directory.Model.dll\\DirectoryService.csdl|Halliburton.PEToolkit.DataServices.Directory.Model.dll\\DirectoryService.ssdl|Halliburton.PEToolkit.DataServices.Directory.Model.dll\\DirectoryService.msl
The exception keeps saying this is an invalid connection string and that a provider must be supplied. What provider? I've got no underlying persistence layer in this case. I've tried appending "; provider=" to the end of this string with no luck.
Help! I'm getting very frustrated. Been at this more than a day now :(
|