public async Task NaoDeveFecharCasoComandaInValido() { IComandaService comandaService = _serviceProvider.GetRequiredService <IComandaService>(); var result = await comandaService.ConfirmarAsync(Guid.Empty); result.Should().BeNull(); comandaService.MensagensValidacao.Should().NotBeNull(StringHelper.JoinHtmlMensagem(comandaService.MensagensValidacao)); comandaService.MensagensValidacao.Any(c => c == ComandaMessage.ComandaInvalida).Should().BeTrue(); }
public async Task DeveConfirmarCasoComandaValido() { MockComandaParameter parameter = new MockComandaParameter() { Exists = true, Comanda = MockHelper.Obter <Comanda>(), Comandas = MockHelper.ObterTodos <Comanda>() }; IComandaService comandaService = Startup.GetServiceProvider(new ServiceParameter(parameter)).GetRequiredService <IComandaService>(); var result = await comandaService.ConfirmarAsync(Guid.NewGuid()); result.Should().NotBeNull(StringHelper.JoinHtmlMensagem(comandaService.MensagensValidacao)); }
public async Task <IActionResult> Confirmar([FromBody] DtoBase <Guid> dto) { return(await ExecutarFuncaoAsync(() => _service.ConfirmarAsync(dto.Id))); }