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

            TestStore <Bean> .ExceptionOnCall = false;
            broker.DeleteAllByCriteria(new FilterCriteria().Equals(Bean.Cols.BEA_ID, 3));
        }
Ejemplo n.º 2
0
        public void TestDeleteAllLikeNull()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            broker.DeleteAllByCriteria(null);
        }
Ejemplo n.º 3
0
        public void TestDeleteAllLikeTransactionScope()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            broker.DeleteAllByCriteria(new FilterCriteria().Equals(Bean.Cols.BEA_ID, 3));
            Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope);
        }
Ejemplo n.º 4
0
        public void TestDeleteAllLikeTransactionComplete()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) {
                broker.DeleteAllByCriteria(new FilterCriteria().Equals(Bean.Cols.BEA_ID, 0));
                tx.Complete();
            }
            Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope);
        }
Ejemplo n.º 5
0
        public void TestDeleteAllLikeTransactionRollback()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

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