I want to perform "fast integration" (aka "desktop integration") tests of a project using EF 4.0/4.1 connected to SQL Server 2008. This means that I need to swap out the dependency upon SQL Server 2008 with something more light-weight. I will like to swap-in SQL CE 4.0, as executed from mstest or mbunit.
I have already determined how I need to transform the EDMX file to make it compatible with SQL CE 4.0. My intention is to generate the EDMX, for CE use, from a pre-build event in my mstest or mbunit project. But what I need to know is how I convince EF to use my newly generated EDMX file, from within my test project, instead of the production EDMX file? I don't think it is as simple as changing my connection string.
I suspect the EDMX file is embedded into the built assemblies as a resource, so maybe this question is about how to swap a resource before it gets compiled into a DLL. If, however, I'm going about this incorrectly, I'd just like guidance of how to achieve my goal.