public void TestDeleteAllLike() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; broker.DeleteAllByCriteria(new FilterCriteria().Equals(Bean.Cols.BEA_ID, 3)); }
public void TestDeleteAllLikeNull() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; broker.DeleteAllByCriteria(null); }
public void TestDeleteAllLikeTransactionScope() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; broker.DeleteAllByCriteria(new FilterCriteria().Equals(Bean.Cols.BEA_ID, 3)); Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope); }
public void TestDeleteAllLikeTransactionComplete() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) { broker.DeleteAllByCriteria(new FilterCriteria().Equals(Bean.Cols.BEA_ID, 0)); tx.Complete(); } Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope); }
public void TestDeleteAllLikeTransactionRollback() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = true; using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) { try { broker.DeleteAllByCriteria(new FilterCriteria()); } catch { // On intercepte l'exception. } tx.Complete(); } Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope); }