Beispiel #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));
        }
Beispiel #2
0
        public void TestDeleteAllLikeNull()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            broker.DeleteAllByCriteria(null);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }