Reputation: 26018
I want to test the data layer, how do I go about this? I am using NUnit for my business object testing. Must I use mock objects (which I have never used before)?
I would appreciate any amount of input if someone can just guide me in the right direction.
Upvotes: 0
Views: 770
Reputation: 83254
You would have to do this:
Here's an answer on unit testing DAL that you might find useful.
Upvotes: 4
Reputation: 17288
Using mock objects depends upon your unit tests. If you dont want to initialize many objects for testing a single object you can use a mock to simulate the behavior of the other objects.
For testing DAL objects you will have to reset the DB State every time you run a test. As running tests on your database will create many records which might change the state of the DB.
Upvotes: 1