«« Next » « Previous
«« Next » « Previous

Link Details

Woulda, coulda, shoulda! Login and vote now.
Link 92856 thumbnail

By bloid
via andrewtokeley.net
Published: Jul 08 2008 / 03:05

In Linq to Sql we always work with a DataContext object (which doesn’t implement any interface) which exposes the database tables as Table> (which do not implement an interface either). This means it’s not possible to mock either the DataContext or the data tables without using expensive mocking software (for example, Typemock.net). So it isn’t really possible to unit test your Linq to SLQ queries without being connected to the underlying data source – not ideal. But fear not, here is a generic solution to this problem.
  • 7
  • 0
  • 419
  • 71

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (7)



Voters Against This Link (0)