Example #1
0
        public void TwoLevelTransaction2()
        {
            Post.DeleteAll();
            Blog.DeleteAll();

            FirstService service = container.Resolve <FirstService>();

            try
            {
                service.CreateBlogAndPost2();
            }
            catch (Exception)
            {
            }

            Assert.AreEqual(0, Blog.FindAll().Length);
            Assert.AreEqual(0, Post.FindAll().Length);
        }
Example #2
0
        public void TwoLevelTransaction2()
        {
            Post.DeleteAll();
            Blog.DeleteAll();

            FirstService service = container.Resolve <FirstService>();

            using (new SessionScope())
            {
                Blog.FindAll();                 // side effects only

                try
                {
                    service.CreateBlogAndPost2();
                }
                catch (Exception)
                {
                }
            }

            Assert.AreEqual(0, Blog.FindAll().Length);
            Assert.AreEqual(0, Post.FindAll().Length);
        }