public void BeginTransaction() { TransactionCheckCommand command = new TransactionCheckCommand(); commandExecutor.Execute(command); Assert.IsNotNull(command.transaction); Assert.IsNull(TransactionManager.Transaction()); }
public void ParticipateInTransaction() { SqlTransaction myTransaction = TransactionManager.Begin(Connection); TransactionCheckCommand command = new TransactionCheckCommand(); commandExecutor.Execute(command); Assert.AreSame(myTransaction, command.transaction); TransactionManager.Rollback(); }
public async void Should_EvaluateTransactionAsync_Valid() { var transactionCheckCommand = new TransactionCheckCommand { Id = 1.ToGuid().ToString(), AccountId = 1.ToGuid().ToString(), ProfileId = "awesome", Amount = 1, Info = "info", Timestamp = DateTime.Now.ToString(CultureInfo.InvariantCulture), Version = 0 }; transactionCheckCommand.SetPending(); var transactionIsCheckedEvent = await _manager.EvaluateTransactionAsync( transactionCheckCommand ); Assert.NotNull(transactionIsCheckedEvent); Assert.True(transactionIsCheckedEvent.IsApproved()); }