O'Reilly logo

NHibernate 3 Beginner's Guide by Gabriel N. Schenker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Testing, Profiling, Monitoring, and Logging

Up till now, we were living in a perfect world, where no errors occurred. We were assuming that everything works just fine and as expected. Unfortunately, reality can be cruel and things just don't always work out as expected.

In this chapter, we shall:

  • Implement a base framework to make testing database access code easy
  • Create tests to verify our data access code
  • Analyze the communication of NHibernate with the database
  • Configure NHibernate to log interesting information

So let's get on with it.

Why do we need tests?

There are different reasons why we would want to write tests for our code. In test-driven development (TDD), we write tests to help us write better code. In this regard, tests are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required