public void WhenCreated_ThenNewTransactionIsStarted() { using (var tx = new DTCTransactionScope(null, new TransactionOptions(), sessionFactoryMock.Object)) { Transaction.Current.Should().NotBeNull(); tx.Complete(); } }
public void WhenCompleted_ThenTransactionShouldBeCommitted() { var transactionStatus = TransactionStatus.InDoubt; using (var tx = new DTCTransactionScope(null, new TransactionOptions(), sessionFactoryMock.Object)) { Transaction.Current.TransactionCompleted += (s, e) => transactionStatus = e.Transaction.TransactionInformation.Status; tx.Complete(); } transactionStatus.Should().Be(TransactionStatus.Committed); }