Exemplo n.º 1
0
        public async void Run_Recurrence_Null_Validation()
        {
            // Arrange
            var invoice = new Invoice()
            {
                Recurrence = null
            };

            // Act
            var result = _engine.Run(invoice, new DateTime(DateTime.Now.Year, 1, 1));

            // Assess
            Assert.Empty(result);
        }
        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;
        }