public void TestDelete() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; broker.Delete(0); }
public void TestDeleteTransactionScope() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; broker.Delete(0); Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope); }
public void TestDeleteTransactionComplete() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) { broker.Delete((int?)0); tx.Complete(); } Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope); }
public void TestDeleteTransactionRollback() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = true; using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) { try { broker.Delete(0); } catch { // On intercepte l'exception. } tx.Complete(); } Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope); }