Question

Is it possible to run unit tests in Visual Studio 2012 against a localDb that is built with Entity Framework 5.0 Code-First? Currently our development is against a SQL Express Server Instance but this will not work with AppHarbor deployments since the Db is unavailable.

Was it helpful?

Solution

I'm not sure that using LocalDB would solve your problem. To use LocalDB, LocalDB still has to be installed on the machine running your unit tests and that may not be the case on AppHarbor.

Consider these resources for alternatives:

  1. Integration Testing Entity Framework code first with in-memory database (use SQL Server CE using a file in unit test directory)
  2. Effort (let's you create schema and run unit tests in memory without touching the file system - probably preferable)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top