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

Preparing our environment for testing

To be able to write unit tests, we need to prepare a small framework. First of all, let's introduce a base class, which allows us to write our unit tests in a more "natural" way that resembles English text, instead of it remaining purely technical babble.

A unit test normally consists of three clearly distinguishable parts:

  • Arrange – we prepare or set up the boundary conditions for our test
  • Act – we execute the action whose outcome we want to test
  • Assert – finally, we verify that the outcome of the action is indeed what we expect

These three steps, arrange, act, and assert, are sometimes also denoted with the acronym AAA. In the unit tests, we are going to write these three steps in the form of their counterparts. ...

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