コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }