コード例 #1
0
        public void TestDelete()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            broker.Delete(0);
        }
コード例 #2
0
        public void TestDeleteTransactionScope()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            broker.Delete(0);
            Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope);
        }
コード例 #3
0
        public void TestDeleteTransactionComplete()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) {
                broker.Delete((int?)0);
                tx.Complete();
            }
            Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope);
        }
コード例 #4
0
        public void TestDeleteTransactionRollback()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = true;
            using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) {
                try {
                    broker.Delete(0);
                } catch {
                    // On intercepte l'exception.
                }
                tx.Complete();
            }
            Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope);
        }