public IActionResult Create([FromBody] Ingrediente ingrediente) { if (ingrediente == null) { return(BadRequest()); } _ingredienteBll.Add(ingrediente); return(CreatedAtRoute("GetIngrediente", new { id = ingrediente.Id }, ingrediente)); }
public void TestAdd() { var ingrediente = new Ingrediente() { Descricao = "Teste", Valor = 300 }; _ingredienteBll.Add(ingrediente); _ingredienteRepositoryMock.Verify(x => x.Add(ingrediente), Times.Once()); }