public async void ShouldInsertWithSucess() { var revendedor = new Revendedor() { NomeCompleto = "Nome", CPF = "111.222.333-00", Email = "*****@*****.**", Senha = "1234", }; await _revendedorService.InsertAsync(revendedor); var compra = new Compra(1, 1200); var command = await _service.InsertAsync(compra, revendedor.CPF); Assert.NotNull(command); var compraBd = await _repository.FindAsync(command.Id); Assert.NotNull(compraBd); }
public async Task <IActionResult> Create([FromBody] ComprasViewModel model) { var response = await _service.InsertAsync(_mapper.Map <Compra>(model), model.CpfRevendedor); return(Ok()); }