コード例 #1
0
        public void ApplService_NotaFiscal_Get_Deve_Retornar_Uma_NotaFiscal()
        {
            //Arrange
            var notafiscal = ObjectMother.NotaFiscalValidaComId;

            _notaFiscalRepository.Setup(nf => nf.GetById(notafiscal.Id)).Returns(notafiscal);
            //Action
            var notaResult = _notaFiscalService.GetById(notafiscal.Id);

            //Assert
            _notaFiscalRepository.Verify(nf => nf.GetById(notafiscal.Id), Times.Once);
            notaResult.Should().NotBeNull();
            notaResult.Should().BeOfType <NotaFiscal>();
            notaResult.Id.Should().Be(notafiscal.Id);
        }
コード例 #2
0
 public IHttpActionResult GetById(int id)
 {
     return(HandleCallback(() => Mapper.Map <NotaFiscalExtend>(_notaFiscalService.GetById(id))));
 }