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.
You would have to do this:
Here's an answer on unit testing DAL that you might find useful.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.