Home  /  Questions  /  Question

50   50
Sep 06, 2011

How to Unit test the Data Objects layer

I'm looking for some guidance for a best practice on writing the unit test for the Data Objects layer and specifically the Ado.Net implementation.

I'm seen many examples using the repository pattern where you can fake the repository, but since the doFactory framework is not using Repository in the Data Layer, I'm not sure how to mock the actual calls to the database.

Thanks for any guidance you can provide.


1,364   100.0
Oct 28, 2011
I guess in dofactory framework they use "Abstract Factory" pattern for Data Layer, and in that case you can easily mock the interface or abstract class for unit testing of your DB.