Exemple #1
0
        public void TestGetAllLike()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            Assert.IsNotNull(broker.GetAllByCriteria(new FilterCriteria(), new QueryParameter(3)));
        }
Exemple #2
0
        public void TestGetAllLikeTransactionScope()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            Assert.IsNotNull(broker.GetAllByCriteria(new FilterCriteria()));
            Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope);
        }
Exemple #3
0
        public void TestGetAllLikeManyRows()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            ICollection <Bean> coll = broker.GetAllByCriteria(new FilterCriteria(), new QueryParameter(5));

            Assert.AreEqual(5, coll.Count);
        }
Exemple #4
0
        public void TestGetAllLikeTransactionComplete()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) {
                Assert.IsNotNull(broker.GetAllByCriteria(new FilterCriteria()));
                tx.Complete();
            }
            Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope);
        }
Exemple #5
0
        public void TestGetAllLikeTransactionRollback()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

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