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); }
public IHttpActionResult GetById(int id) { return(HandleCallback(() => Mapper.Map <NotaFiscalExtend>(_notaFiscalService.GetById(id)))); }