public void TestGetAll() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; Assert.IsNotNull(broker.GetAll()); }
public void TestGetAllTransactionScope() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; Assert.IsNotNull(broker.GetAll()); Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope); }
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); }
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); }
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); }