Using Fluent NHibernate persistence testing

Mappings are a critical part of any NHibernate application. In this recipe, we'll show you how to use Fluent NHibernate's persistence testing, in order to make sure that your mappings work as expected. You don't have to use Fluent NHibernate mappings in order to take advantage of this recipe.

Getting ready

Complete the Fast testing with the SQLite in-Memory database recipe mentioned earlier in this chapter.

How to do it...

  1. Install FluentNHibernate using the NuGet Package Manager Console by executing the following command:
    Install-Package FluentNHibernate
    
  2. In PersistenceTests.cs, add the following using statement:
    using FluentNHibernate.Testing;
  3. Add the following three tests to the PersistenceTests fixture: ...

Get NHibernate 4.x Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.