public async void Should_ProcessTransactionCheckedEventAsync_Approved()
        {
            var transactionProcessedEvent = new TransactionIsCheckedEvent
            {
                Id        = 1.ToGuid().ToString(),
                ProfileId = 1.ToGuid().ToString()
            };

            transactionProcessedEvent.SetApproval();
            var updatedTransaction = await _manager.ProcessTransactionCheckedEventAsync(transactionProcessedEvent);

            Assert.NotNull(updatedTransaction);
            Assert.True(updatedTransaction.IsApproved());
        }
Exemplo n.º 2
0
        public async Task Consume(ConsumeContext <TransactionIsCheckedEvent> context)
        {
            _logger.LogDebug($"Received new TransactionProcessedEvent for {context.Message.Id}");
            var result = await _transactionsManager.ProcessTransactionCheckedEventAsync(context.Message);

            if (result == null)
            {
                throw new Exception($"Could not process an event {context.Message.Id}");
            }
        }