How are people unit testing code that uses Linq to SQL

后端 未结 7 818
生来不讨喜
生来不讨喜 2021-01-30 06:24

How are people unit testing code that uses Linq to SQL?

相关标签:
7条回答
  • 2021-01-30 07:19

    Update:

    Fredrik has put an example solution on how to do unit test linq2sql applications over at his blog. You can download it at:

    http://web.archive.org/web/20120415022448/http://iridescence.no/post/DataContext-Repository-Pattern-Example-Code.aspx

    Not only do I think its great that he posted an example solution, he also managed to extract interfaces for all classes, which makes the design more decoupled.

    My old post:

    *I found these blogs that I think are a good start for making the DataContext wrapper: Link1 Link2

    They cover almost the same topic except that the first one implements means for extracting interfaces for the tables as well. The second one is more extensive though, so I included it as well.*

    0 讨论(0)
提交回复
热议问题