I have lagecy ASP.Net code which accesses database. There is data access layer which forms sqlcommands and executes on the database.
What is the best way to unit test the data access layer? Should we actually connect to database and execute test case or just use fakes?
Is it a good idea to use shim (described in below post)?
Assume your legacy DLL is managed, you should be able to use Fakes feature in VS2012. Fakes is really meant for doing this. A typical usage of Fakes works like:
You can also find useful info on http://msdn.microsoft.com/en-us/library/hh708916.aspx