public async Task Handle(InvoiceCreatedEvent notification, CancellationToken cancellationToken)
        {
            _logger.LogInformation("InvoiceCreatedEvent: {invoice}", notification);

            var statementCreatorEngine = new StatementCreatorEngine(_loggerFactory.CreateLogger <StatementCreatorEngine>());

            var statementList = statementCreatorEngine.Run(notification.New, DateTime.Now);

            foreach (var statement in statementList)
            {
                await _mediatorHandler.SendCommand(statement);
            }

            return;
        }
Example #2
0
        public StatementCreatorEngineTests()
        {
            _mocker = new AutoMocker();

            _engine = _mocker.CreateInstance <StatementCreatorEngine>();
        }