public void GenerateInitialisedDatabase() { DatabaseGenerator.GenerateInitialisedDatabase(); var testDatabaseFolder = new DirectoryInfo(TestSession.GenerateDatabaseFolderPath()); testDatabaseFolder.Create(); try { DatabaseConnection.InitialiseDatabase( DatabaseGenerator.InitialisedDatabaseFolderPath !, testDatabaseFolder.FullName); var data = new TestData(new QueryHelper()); var session = new SessionNoServer(testDatabaseFolder.FullName); session.BeginUpdate(); data.AddSchemaPersisted(1, session); DatabaseGenerator.AddOneOfEachEntityTypePersisted(data, session); session.Commit(); } finally { try { testDatabaseFolder.Delete(true); } catch { // Don't obscure the original exception, if any. } } }