public void TestGetNull() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; broker.Get(null); }
public void TestGet() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; Assert.IsNotNull(broker.Get(new object())); }
public void TestGetTransactionScope() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; Assert.IsNotNull(broker.Get(new object())); Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope); }
public void TestGetTransactionComplete() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = false; using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) { Assert.IsNotNull(broker.Get(new object())); tx.Complete(); } Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope); }
public void TestGetTransactionRollback() { StandardBroker <Bean> broker = new StandardBroker <Bean>("name"); TestStore <Bean> .ExceptionOnCall = true; using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) { try { broker.Get(new object()); } catch { // On intercepte l'exception. } tx.Complete(); } Assert.IsTrue(TestStore <Bean> .IsCallWithTransactionScope); }