Integration Testing Entity Framework code first with in-memory database

后端 未结 2 504
没有蜡笔的小新
没有蜡笔的小新 2020-12-03 02:09

I\'d like to run actual integration tests of my EF4.1 repositories against an in-memory database a la ayende\'s nhibernate version.

I have a code first model, agains

2条回答
  •  臣服心动
    2020-12-03 02:39

    Use SQL Compact 4.0 (download both SqlCE and tools by web platform installer) - EF Code first has direct support for that. The only difference will be that your application will use connection string to big SQL Server:

    
    

    and your tests will use connection string to SQL Compact:

    
    

提交回复
热议问题