예제 #1
0
        public void RequireDbContextHandler_NestedDoInDbContextWithException_DbRollback()
        {
            Assert.Throws <InvalidOperationException>(() => RepoA.AddDoubleItemException());

            Assert.False(DbContextFactory.IsOpen());

            DbContextTemplate.ExecuteQuery <TestDbContext>(ctx => Assert.Empty(Items));
        }
예제 #2
0
        public void RequireDbContextHandler_NestedCallOnRequireDbMethod_ItemCreated()
        {
            RepoA.AddDoubleItem();

            Assert.False(DbContextFactory.IsOpen());

            DbContextTemplate.ExecuteQuery <TestDbContext>(ctx => Assert.Equal(2, Items.Count()));
        }