How are people unit testing code that uses Linq to SQL

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

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

7条回答
  •  囚心锁ツ
    2021-01-30 07:01

    LINQ to SQL is actually really nice to unit test as it has the ability to create databases on the fly from what is defined in your DBML.

    It makes it really nice to test a ORM layer by creating the DB through the DataContext and having it empty to begin with.

    I cover it on my blog here: http://web.archive.org/web/20090526231317/http://www.aaron-powell.com/blog/may-2008/unit-testing-linq-to-sql.aspx

提交回复
热议问题