Beispiel #1
0
        public void Conta_Controller_Put_Sacar_Sucesso()
        {
            double valorSaque = 10;
            var    conta      = ObjectMother.ObterContaValida();

            _contaServicoMock.Setup(c => c.Sacar(conta.Id, valorSaque)).Returns(conta);

            IHttpActionResult callback = _contasController.Sacar(conta.Id, valorSaque);

            var httpResponse = callback.Should().BeOfType <OkNegotiatedContentResult <Conta> >().Subject;

            httpResponse.Content.Should().NotBeNull();
            _contaServicoMock.Verify(s => s.Sacar(conta.Id, valorSaque), Times.Once);
        }