Ejemplo n.º 1
0
        public void TestDelete()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            broker.Delete(0);
        }
Ejemplo n.º 2
0
        public void TestDeleteTransactionScope()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            broker.Delete(0);
            Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }