示例#1
0
        public void TestGetAll()
        {
            var data = new Collection <Ingrediente> {
                new Ingrediente {
                    Id = 1, Descricao = "Teste 1", Valor = 30
                },
                new Ingrediente {
                    Id = 2, Descricao = "Teste 2", Valor = 540
                },
                new Ingrediente {
                    Id = 3, Descricao = "Teste 4", Valor = 71
                }
            };

            _ingredienteRepositoryMock.Setup(theObject => theObject.GetAll()).Returns(data);
            var ingredientes = _ingredienteBll.GetAll();

            _ingredienteRepositoryMock.Verify(x => x.GetAll(), Times.Once());
            Assert.Equal(3, ingredientes.Count());
        }
        public IEnumerable <Ingrediente> GetAll()
        {
            var result = _ingredienteBll.GetAll();

            return(result);
        }