Unit testing and DB isolation via pex and moles

387 Views Asked by At

I have a VS winforms project which has lot of database calls.

Whenever i create unit testing, there is more number of methods, taking more time to consume and more number of unit test projects.

How do i isolate DB calls or will i be able to isolate DB calls if i use microsoft's moles and pex? Any samples on moles and pex will be highly helpful.

1

There are 1 best solutions below

0
On

You can isolate anything - database calls, web services calls, SharePoint. It does not matter. Your project has references to a number of external dependencies like System.Data. You can either grab the pre-built moles assemblies or build you own. Framework is pretty rough at some points, but it works.