public void TestaAtivacaoServico() { var resultServico = new ServicoBuilder().ComSituacaoId((int)ESituacao.CANCELADO).Build(); resultServico.AtivarServico(); Assert.IsTrue(resultServico.SituacaoId == (int)ESituacao.ATIVO); }
public void TestaCancelamentoServico() { var resultServico = new ServicoBuilder().Build(); resultServico.CancelarServico(); Assert.IsTrue(resultServico.SituacaoId == (int)ESituacao.CANCELADO); }
public void TestaDesativacaoServico() { var resultServico = new ServicoBuilder().Build(); resultServico.DesabilitarServico(); Assert.IsTrue(resultServico.SituacaoId == (int)ESituacao.INATIVO); }
public AtendimentoItemDtoBuilder() { var servicoBuilder = new ServicoBuilder().ComCorte().Build(); AtendimentoItemId = Interlocked.Increment(ref nextId); Valor = 30; ServicoId = servicoBuilder.ServicoId; ServicoNome = servicoBuilder.Nome; }
public void TestaObterPorIdValido() { int servicoId = 1; Servico resultServico = new ServicoBuilder().ComID(servicoId).Build(); _servicoRepository.Setup(x => x.ObterPorId(servicoId)).ReturnsAsync(resultServico); var retorno = _servicoService.ObterPorId(servicoId); Assert.IsTrue(retorno.Result.StatusCode == (int)EStatusCode.OK); Assert.IsTrue(retorno.Result.Errors.Count == 0); Assert.IsNotNull(retorno.Result.Data); }
public void TestaAtualizacaoServico() { var resultServico = new ServicoBuilder().Build(); var novoNome = "Novo Serviço"; var novoValor = 10; var novaDuracao = 15; var novoEstabelecimento = 2; resultServico.AtualizarServico(new ServicoDto { Nome = novoNome, Valor = novoValor, Duracao = novaDuracao, EstabelecimentoId = novoEstabelecimento }); Assert.IsTrue(resultServico.Nome == novoNome); Assert.IsTrue(resultServico.Valor == novoValor); Assert.IsTrue(resultServico.Duracao == novaDuracao); Assert.IsTrue(resultServico.EstabelecimentoId == novoEstabelecimento); }
public AgendamentoDtoBuilder() { var servicoBuilder = new ServicoBuilder().ComCorte().Build(); var estabelecimentoDtoBuilder = new EstabelecimentoDtoBuilder().ComBarbearia().Build(); var usuarioDtoBuilder = new UsuarioDtoBuilder().ComCliente1().Build(); AgendamentoId = Interlocked.Increment(ref nextId); DataAgendamento = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 10, 0, 0); DataFinalAgendamento = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 11, 0, 0); DataAgendamentoStr = DateTime.Now.Day + "/" + DateTime.Now.Month.ToString().PadLeft(2, '0') + "/" + DateTime.Now.Year + " 10:00"; DataFinalAgendamentoStr = DateTime.Now.Day + "/" + DateTime.Now.Month.ToString().PadLeft(2, '0') + "/" + DateTime.Now.Year + " 11:00"; ServicoId = servicoBuilder.ServicoId; ServicoNome = servicoBuilder.Nome; ServicoValor = servicoBuilder.Valor; UserId = usuarioDtoBuilder.Id; UsuarioNome = usuarioDtoBuilder.Nome; Situacao = ESituacao.ATIVO.GetDescription(); EstabelecimentoId = estabelecimentoDtoBuilder.EstabelecimentoId; EstabelecimentoNome = estabelecimentoDtoBuilder.Nome; }