Skip to content

Instantly share code, notes, and snippets.

@stefansedich
Created May 22, 2011 00:55
Show Gist options
  • Save stefansedich/985040 to your computer and use it in GitHub Desktop.
Save stefansedich/985040 to your computer and use it in GitHub Desktop.
[SetUp]
public void SetUp()
{
_cleanupListener = new CleanupTestDataEventListener();
var cfg = new Configuration()
.DataBaseIntegration(x =>
{
x.Dialect<SQLiteDialect>();
x.ConnectionString = "Data Source=test.db;Version=3;";
x.SchemaAction = SchemaAutoAction.Update;
x.LogSqlInConsole = true;
});
var mapper = new ConventionModelMapper();
var mappings = mapper.CompileMappingFor(new[] {typeof (Person), typeof(Foo)});
cfg.AddDeserializedMapping(mappings, "Application");
cfg.AppendListeners(ListenerType.PostInsert, new[] {_cleanupListener});
_sessionFactory = cfg.BuildSessionFactory();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment