public void Init()
 {
     using (var context = new SqlServerFullContext(Configuration))
     {
         context.DropSchema();
         context.CreateSchema();
     }
 }
Beispiel #2
0
        public static void Init(TestContext tstContext)
        {
            Configuration = Fluently.Configure().Database(MsSqliteConfiguration.Standard.ConnectionString("Data Source=:memory:;cache=shared;mode=memory")).Mappings(
                o => o.FluentMappings
                .AddFromAssemblyOf <Banking.Models.Context.Mappings.NHib.SqlServer.BankAccountMap>()).BuildConfiguration();

            // Keep connection to in-memory db alive for duration of test
            // otherwise the db gets discarded when all connections are closed
            Context = new SqlServerFullContext(Configuration);
            Context.CreateSchema();
        }