Should I Unit Test Data Access Layer? Is this a good practice and how to do it?

Viewed 6077

If I'm having Data Access Layer (nHibernate) for example a class called UserProvider and a Business Logic class UserBl, should I both test their methods SaveUser or GetUserById, or any other public method in DA layer which is called from BL layer. Is this a redundancy or a common practice to do?

Is it common to unit test DA layer, or that belongs to Integration test domain? Is it better to have test database, or create database data during test?

Any help is appreciated.

4 Answers
Related