Exemplo n.º 1
0
            public void ValidationSucceeds()
            {
                AddExpenseInfo command = new AddExpenseInfo();

                List <ValidationResult> results = addExpenseValidator.Validate(command).ToList();

                // Assert
                Assert.Empty(results);
            }
Exemplo n.º 2
0
        public IActionResult Create([FromBody] AddExpenseInfo expenseToProcess)
        {
            try {
                addExpense.Handle(expenseToProcess);
            }
            catch (Exception e) {
                // TODO - Log exception
                return(new ExceptionActionResult(e));
            }

            return(Ok("Expense created successfully."));
        }