Esempio n. 1
0
        public void TestGetAll()
        {
            StandardBroker <Bean> broker = new StandardBroker <Bean>("name");

            TestStore <Bean> .ExceptionOnCall = false;
            Assert.IsNotNull(broker.GetAll());
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }