开发者

How to MOLE the DataContext

开发者 https://www.devze.com 2023-03-28 11:39 出处:网络
I\'m trying to figure out how to mole the datacontext so that my unit tests never hit the database. What I want to achieve is that a datacontext is create开发者_C百科dbut doesn\'t connect to a db and

I'm trying to figure out how to mole the datacontext so that my unit tests never hit the database.

What I want to achieve is that a datacontext is create开发者_C百科d but doesn't connect to a db and then when I call GetTable (via my repository) I return a List.AsQueryable() (that I create myself in the unit test).


Found the issue here: http://dimecasts.net/Content/WatchEpisode/170

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号