public void EmprestimoIntegracao_Adicionar_ShouldBeOk() { //Executa Emprestimo emprestimo = ObjetoMaeEmprestimo.obterEmprestimo(); emprestimo.Livro.Id = 1; Emprestimo emprestimoAdd = _service.Salvar(emprestimo); //Saída emprestimo.Id.Should().BeGreaterThan(0); var last = _service.Obter(emprestimo.Id); last.Should().NotBeNull(); var posts = _service.ObterTodos(); posts.Count().Should().BeGreaterThan(0); }
public void EmprestimoService_GetAll_ShouldBeOk() { _mockRepository.Setup(m => m.ObterTodos()).Returns(new List <Emprestimo>()); EmprestimoService service = new EmprestimoService(_mockRepository.Object); IEnumerable <Emprestimo> resultado = service.ObterTodos(); resultado.Should().NotBeNull(); _mockRepository.Verify(repository => repository.ObterTodos()); }