public void DisposeWhenClosesContext() { var db = MemoryDBForTests.NewDB(); CurrentContext.NewContext(NewContext(db)); CurrentContext.CloseContext(); Assert.IsTrue(db.Ext().IsClosed()); }
private IObjectContainer Configure(DatabaseMetaInfo info) { return(MemoryDBForTests.NewDB( config => { var toTest = new DatabaseConfigurator(info); toTest.Configure(config); })); }
public void DirectQuery() { var db = MemoryDBForTests.NewDB(); db.Store(new ClassWithFields()); CurrentContext.NewContext(NewContext(db)); var query = CurrentContext.Query <ClassWithFields>(); Assert.AreNotEqual(0, query.Count()); CurrentContext.CloseContext(); }
private DatabaseContext NewContext() { return(NewContext(MemoryDBForTests.NewDB())); }
public static void WithTestContext(Action action) { var db = MemoryDBForTests.NewDB(); WithTestContext(db, TestTypeResolver(), action); }