public void TestGetAllLike() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; Assert.IsNotNull(broker.GetAllByCriteria(new FilterCriteria(), new QueryParameter(3))); }
public void TestGetAllLikeTransactionScope() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; Assert.IsNotNull(broker.GetAllByCriteria(new FilterCriteria())); Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope); }
public void TestGetAllLikeManyRows() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; ICollection <Bean> coll = broker.GetAllByCriteria(new FilterCriteria(), new QueryParameter(5)); Assert.AreEqual(5, coll.Count); }
public void TestGetAllLikeTransactionComplete() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) { Assert.IsNotNull(broker.GetAllByCriteria(new FilterCriteria())); tx.Complete(); } Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope); }
public void TestGetAllLikeTransactionRollback() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = true; using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) { try { broker.GetAllByCriteria(new FilterCriteria()); } catch { // On intercepte l'exception. } tx.Complete(); } Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope); }