I'm working on a project that uses MSTest for unit testing and I need to write some unit tests for a model class thats fairly tightly coupled to the data source. We maintain the source code for the database that the model classes are dependent on in a Database Project (.dbproj). What I was thinking of doing was writing a ClassInitialize method on my test class that uses the Database Project to programatically build a SQL CE instance of our database that I could then populate with data that I could connect my model class to and perform tests against it with known data.
I'm open to other suggestions if anyone has them.
What I'm trying to figure out how to do is run this Database Project from within code in my ClassInitialize method. I haven't been able to find any good examples of how to do something like that. Is this possible? If so, how? Anyone have a code sample? Thanks.