コード例 #1
0
        public void Controller_Contas_GerarExtrato_DevePassar()
        {
            // Arrange
            var conta   = ContaObjectMother.GetContaValida();
            var extrato = conta.GerarExtrato();

            _contaServiceMock.Setup(s => s.GetExtrato(conta.Id)).Returns(extrato);
            // Action
            var callback = _contasController.GetExtrato(conta.Id);

            //Assert
            _contaServiceMock.Verify(s => s.GetExtrato(conta.Id), Times.Once);
            var httpResponse = callback.Should().BeOfType <OkNegotiatedContentResult <Extrato> >().Subject;

            httpResponse.Content.Should().NotBeNull();
        }