public IActionResult GetById(int id)
        {
            var retorno = _pedidoLancheBll.Find(id);

            if (retorno == null)
            {
                return(NotFound());
            }

            return(new ObjectResult(retorno));
        }
Exemple #2
0
        public void TestFind()
        {
            var data = new PedidoLanche {
                Id = 1, IdLanche = 1, ValorFinal = 30
            };

            _pedidoLancheRepositoryMock.Setup(theObject => theObject.Find(1)).Returns(data);
            var ingrediente = _pedidoLancheBll.Find(1);

            _pedidoLancheRepositoryMock.Verify(x => x.Find(1), Times.Once());
            Assert.NotNull(ingrediente);
            Assert.Equal(1, ingrediente.Id);
        }