Beispiel #1
0
        public void Controller_Contas_GetById_DevePassar()
        {
            // Arrange
            var conta = ContaObjectMother.GetContaValida();

            _contaServiceMock.Setup(c => c.GetById(conta.Id)).Returns(conta);
            // Action
            IHttpActionResult callback = _contasController.GetById(conta.Id);
            // Assert
            var httpResponse = callback.Should().BeOfType <OkNegotiatedContentResult <ContaViewModel> >().Subject;

            httpResponse.Content.Should().NotBeNull();
            httpResponse.Content.Id.Should().Be(conta.Id);
            _contaServiceMock.Verify(s => s.GetById(conta.Id), Times.Once);
        }