public void Test_EmprestimoService_Update_Test_Should_BeOk() { _mock.Setup(x => x.Update(_emprestimo)).Returns(new Emprestimo() { Id = 1 }); var obtido = Alvo.Update(_emprestimo); obtido.Id.Should().BeGreaterThan(0); }
public void Update_Deveria_atualizar_Os_Dados_De_Emprestimo() { //Arrange _emprestimoRepositoryMockObject.Setup(p => p.Update(It.IsAny <Emprestimo>())); //Action Action actionEmprestimoUpdate = () => { _emprestimoService.Update(_emprestimoDefaultWithId); }; //Assert actionEmprestimoUpdate.Should().NotThrow <Exception>(); _emprestimoRepositoryMockObject.Verify(p => p.Update(It.IsAny <Emprestimo>()), Times.Once()); _emprestimoRepositoryMockObject.Verify(p => p.Update(It.IsAny <Emprestimo>())); }
public void Sistema_Deveria_Alterar_Um_Emprestimo_Pelo_Id() { //Arrange Emprestimo resultEmprestimo = _emprestimoService.Add(_emprestimoDefault); resultEmprestimo.Cliente = "Cliente Atualizado"; //Action _emprestimoService.Update(resultEmprestimo); //Assert Emprestimo resultGet = _emprestimoService.Get(resultEmprestimo.Id); resultGet.Should().NotBeNull(); resultGet.Id.Should().Be(resultEmprestimo.Id); resultGet.Cliente.Should().Be("Cliente Atualizado"); }