4

I have an application that connect to an SQL Server database. The database is configured with a connectionString.

I have some unit tests, everything works fine. But it connect to my real database (by reading the connectionString) and my tests populate this database. I do not want that, I rather prefer to connect to an in-memory database, to have no impact on my database.

Does it exist a solution for that? How can I configured my connectionString for tests?

Regards.

ragu89
  • 335
  • 7
  • 22
  • What have you tried? Take a look at [Stubbing / mocking a database in .Net](http://stackoverflow.com/questions/5550128/stubbing-mocking-a-database-in-net) – CodeCaster Mar 12 '13 at 11:19
  • Can you just use a separate database? – usr Mar 12 '13 at 12:40
  • Yes I can, it is what I do now. But I rather prefer not have to maintain another database. – ragu89 Mar 12 '13 at 13:12

0 Answers0