Exemplo n.º 1
0
        public void DisposeWhenClosesContext()
        {
            var db = MemoryDBForTests.NewDB();

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

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

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