public void TestaCreateValido() { var estabelecimentoDto = new EstabelecimentoDtoBuilder().Build(); var retorno = _estabelecimentoService.Create(estabelecimentoDto); Assert.IsTrue(retorno.Result.StatusCode == (int)EStatusCode.OK); Assert.IsTrue(retorno.Result.Errors.Count == 0); Assert.IsNotNull(retorno.Result.Data); Assert.IsTrue(retorno.Result.Data.SituacaoId == (int)ESituacao.ATIVO); }
public void TestaUpdateValido() { var estabelecimentoId = 1; var estabelecimentoDto = new EstabelecimentoDtoBuilder().ComBarbearia().ComID(estabelecimentoId).Build(); var estabelecimento = new EstabelecimentoBuilder().ComID(estabelecimentoId).Build(); _estabelecimentoRepository.Setup(x => x.ObterPorId(estabelecimentoId)).ReturnsAsync(estabelecimento); var retorno = _estabelecimentoService.Update(estabelecimentoDto); Assert.IsTrue(retorno.Result.StatusCode == (int)EStatusCode.OK); Assert.IsTrue(retorno.Result.Errors.Count == 0); Assert.IsNotNull(retorno.Result.Data); }