Пример #1
0
        public void TestaAtivacaoServico()
        {
            var resultServico = new ServicoBuilder().ComSituacaoId((int)ESituacao.CANCELADO).Build();

            resultServico.AtivarServico();

            Assert.IsTrue(resultServico.SituacaoId == (int)ESituacao.ATIVO);
        }
Пример #2
0
        public void TestaCancelamentoServico()
        {
            var resultServico = new ServicoBuilder().Build();

            resultServico.CancelarServico();

            Assert.IsTrue(resultServico.SituacaoId == (int)ESituacao.CANCELADO);
        }
Пример #3
0
        public void TestaDesativacaoServico()
        {
            var resultServico = new ServicoBuilder().Build();

            resultServico.DesabilitarServico();

            Assert.IsTrue(resultServico.SituacaoId == (int)ESituacao.INATIVO);
        }
Пример #4
0
        public AtendimentoItemDtoBuilder()
        {
            var servicoBuilder = new ServicoBuilder().ComCorte().Build();

            AtendimentoItemId = Interlocked.Increment(ref nextId);
            Valor             = 30;
            ServicoId         = servicoBuilder.ServicoId;
            ServicoNome       = servicoBuilder.Nome;
        }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }
Пример #7
0
        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;
        }