public void Service_Conta_EfetuarSaque_DevePassar() { //Arrange _conta = ContaObjectMother.GetContaValida(); _repositoryFake.Setup(x => x.Update(It.IsAny <Conta>())); _repositoryFake.Setup(x => x.GetById(It.IsAny <int>())).Returns(_conta); //Action _service.EfetuarSaque(_conta.Id, 1000); //Verify _repositoryFake.Verify(x => x.Update(_conta)); _conta.SaldoTotal.Should().Be(ContaObjectMother.GetContaValida().SaldoTotal - 1000); }
public IHttpActionResult EfetuarSaque(int id, [FromBody] double valor) { TraceLogManager.Info("Efetuando Saque da Conta!"); return(HandleCallback(() => _contaService.EfetuarSaque(id, valor))); }