Ian Warburton
Ian Warburton

Reputation: 15676

Generate test database for integration tests

Code First Entity Framework can generate a database no trouble. Is there a way of parameterising the generation process such that I can create a fresh database instance just for integration tests?

Upvotes: 1

Views: 140

Answers (1)

Ian Warburton
Ian Warburton

Reputation: 15676

I'm using the same database name but creating a new folder named after the current date by setting the 'DataDirectory'on the AppDomain. EF creates a SQL Server LocalDb with each test run.

Helped by this answer.

Upvotes: 1

Related Questions