public void Reporting_failure_should_commit_info_immediately() { FaultManager.SerializationFailedForMessage(new TransportMessage { ReturnAddress = "returnAddress" }, new Exception()); using (var session = SessionFactory.OpenSession()) { Assert.AreEqual(session.CreateCriteria(typeof(FailureInfo)).List <FailureInfo>().Count, 1); } }
public void Ambient_transaction_should_rollback_saving_failure_info() { using (var transactionScope = new TransactionScope()) { FaultManager.SerializationFailedForMessage(new TransportMessage { ReturnAddress = "returnAddress" }, new Exception()); } using (var session = SessionFactory.OpenSession()) { Assert.AreEqual(session.CreateCriteria(typeof(FailureInfo)).List <FailureInfo>().Count, 0); } }