Mocking Database

Topics: Data Access Application Block
Nov 2, 2011 at 7:41 PM

Hello

I need to perform unit tests on my data access objects  but I can not replace with a mock the database object.

Does anyone know how to do this with DAAB?

Thanks,

Nov 2, 2011 at 11:39 PM

You should be able to mock out the Database methods you need by extending Database with a mock class.

One user mentioned in Mocking Enterprise Lib 5 'Database' that they had success using fakeiteasy.  Perhaps that gives you some ideas.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com