public void ApplService_NotaFiscal_Add_Deve_Incluir_Uma_NotaFiscal() { //Arrange long expectedId = 1; var nota = ObjectMother.NotaFiscalValida; nota.Id = expectedId; var notaRetorno = ObjectMother.NotaFiscalValidaParaRegistro; _notaFiscalRepository.Setup(x => x.Add(It.IsAny <NotaFiscal>())).Returns(nota); //Action var obtido = _notaFiscalService.Add(notaRetorno); //Assert obtido.Should().Be((int)nota.Id); _notaFiscalRepository.Verify(x => x.Add(It.IsAny <NotaFiscal>()), Times.Once); _notaFiscalRepository.VerifyNoOtherCalls(); }
public IHttpActionResult Post(NotaFiscalAddCommand notaFiscal) { return(HandleCallback(() => _notaFiscalService.Add(notaFiscal))); }