Created
May 22, 2011 00:55
-
-
Save stefansedich/985040 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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