예제 #1
0
        public void DisposeWhenClosesContext()
        {
            var db = MemoryDBForTests.NewDB();

            CurrentContext.NewContext(NewContext(db));
            CurrentContext.CloseContext();
            Assert.IsTrue(db.Ext().IsClosed());
        }
예제 #2
0
        private IObjectContainer Configure(DatabaseMetaInfo info)
        {
            return(MemoryDBForTests.NewDB(
                       config =>
            {
                var toTest = new DatabaseConfigurator(info);

                toTest.Configure(config);
            }));
        }
예제 #3
0
        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();
        }
예제 #4
0
 private DatabaseContext NewContext()
 {
     return(NewContext(MemoryDBForTests.NewDB()));
 }
예제 #5
0
        public static void WithTestContext(Action action)
        {
            var db = MemoryDBForTests.NewDB();

            WithTestContext(db, TestTypeResolver(), action);
        }