public async Task ExecuteUpdateTest() { _serviceMock = new Mock <IContaPagarService>(); _serviceMock.Setup(m => m.Put(contaPagarDto)).ReturnsAsync(contaPagarDto); _service = _serviceMock.Object; var result = await _service.Put(contaPagarDto); Assert.NotNull(result); Assert.Equal(Id, result.Id); Assert.Equal(Nome, result.Nome); }
public async Task ExecuteCalculosTest() { _serviceMock = new Mock <IContaPagarService>(); _serviceMock.Setup(m => m.Put(contaPagarDto)).ReturnsAsync(contaPagarDto); _service = _serviceMock.Object; var result = await _service.Put(contaPagarDto); Assert.NotNull(result); Assert.Equal(PercentualMulta, result.PercentualMulta); Assert.Equal(PercentualJuroDia, result.PercentualJuroDia); Assert.Equal(ValorCorrigido, result.ValorCorrigido); }
public async Task ExecuteGetTest() { _serviceMock = new Mock <IContaPagarService>(); _serviceMock.Setup(m => m.Get(Id)).ReturnsAsync(contaPagarGetDto); _service = _serviceMock.Object; var result = await _service.Get(Id); Assert.NotNull(result); Assert.Equal(Nome, result.Nome); _serviceMock = new Mock <IContaPagarService>(); _serviceMock.Setup(m => m.Get(It.IsAny <Guid>())).Returns(Task.FromResult((ContaPagarGetDto)null)); _service = _serviceMock.Object; var _record = await _service.Get(Guid.NewGuid()); Assert.Null(_record); }
public async Task ExecuteDeleteTest() { _serviceMock = new Mock <IContaPagarService>(); _serviceMock.Setup(m => m.Delete(Id)) .ReturnsAsync(true); _service = _serviceMock.Object; var delete = await _service.Delete(Id); Assert.True(delete); _serviceMock = new Mock <IContaPagarService>(); _serviceMock.Setup(m => m.Delete(It.IsAny <Guid>())) .ReturnsAsync(false); _service = _serviceMock.Object; delete = await _service.Delete(Guid.NewGuid()); Assert.False(delete); }
public ContaPagarController(IContaPagarService contaPagarService) : base() { _contaPagarService = contaPagarService; }
public ContaPagarController(IContaPagarService service, IMapper mapper) { this.service = service ?? throw new ArgumentNullException(nameof(service)); this.mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
public ContaPagarController(IContaPagarService contPgService, IAutenticacaoService autenticacaoService) { this._autenticacaoService = autenticacaoService; this._contPgService = contPgService; }
public ContasPagarController(IContaPagarService service) { _service = service; }
public ContaPagarController(IContaPagarService contaPagarService) { _contaPagarServices = contaPagarService; }
public ContaPagarController(IContaPagarService contaPagarService) { _contaPagarService = contaPagarService; }