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

            TestStore <Bean> .ExceptionOnCall = false;
            Assert.IsNotNull(broker.GetAll());
        }
Exemple #2
0
        public void TestGetAllTransactionScope()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

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

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

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

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

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