Example #1
0
        public void AoInstanciarSeInvalidoDeveRetornarNotification()
        {
            var command = new UpdateIngredienteCategoriaCommand();

            Assert.False(command.IsValid());
            Assert.True(command.ValidationResult.Errors.Any());
        }
Example #2
0
        public void AoInstanciarSeValidoNaoDeveRetornarNotification()
        {
            var command = new UpdateIngredienteCategoriaCommand
            {
                Id        = Guid.NewGuid(),
                Descricao = "Categoria"
            };

            Assert.True(command.IsValid());
            Assert.False(command.ValidationResult.Errors.Any());
        }
Example #3
0
        public async Task <IActionResult> Put([FromBody] UpdateIngredienteCategoriaCommand request)
        {
            var response = await _mediator.Send(request);

            return(Response(response));
        }