示例#1
0
        public IActionResult Get()
        {
            var paciente = new RepositorioPaciente();
            var lista    = paciente.ObterPacientes();

            return(Ok(lista));
        }
示例#2
0
        public IActionResult Get(int id)
        {
            var repositorio = new RepositorioPaciente();
            var paciente    = repositorio.ObterPaciente(id);

            return(Ok(paciente));
        }
示例#3
0
        public void BD_como_atendente_devo_registrar_um_agendamento_e_obter_o_mesmo_agendamento()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente    repPaciente;
            Contexto           ctx;
            ServicoAgendamento servicoAgendamento;

            //act
            ctx                = new Contexto();
            repPaciente        = new RepositorioPaciente(ctx);
            repAgendamento     = new RepositorioAgendamento(ctx);
            servicoAgendamento = new ServicoAgendamento(repAgendamento, repPaciente);

            var paciente = repPaciente.obterPaciente("1");
            var data     = DateTime.Now;

            data = data.AddDays(5);
            var agendamento = new Agendamento(paciente, data, ETipoDeTratamento.Quimioterapia_Dia);
            var funfou      = servicoAgendamento.registrarAgendamento(agendamento);

            //assert
            Assert.IsTrue(funfou);
            Assert.IsTrue(repAgendamento.obterAgendamentos().Contains(agendamento));
        }
示例#4
0
 public AgendamentoForm()
 {
     InitializeComponent();
     repoMedico   = new RepositorioMedico();
     repoConsulta = new RepositorioConsulta();
     repoPaciente = new RepositorioPaciente();
 }
示例#5
0
        public PacientesForm()
        {
            InitializeComponent();

            // Inicializa o repositório:
            repo = new RepositorioPaciente();
        }
示例#6
0
        public IActionResult Post([FromBody] PacienteInput input)
        {
            var repositorio = new RepositorioPaciente();
            var paciente    = repositorio.Inserir(input.Nome, input.Cpf, input.Historico);


            return(CreatedAtRoute("GetId", new { id = paciente.Id }, paciente));
        }
示例#7
0
        public IActionResult Delete(int id)
        {
            var repositorio = new RepositorioPaciente();

            repositorio.Excluir(id);


            return(Ok());
        }
示例#8
0
        public IActionResult Put(int id, [FromBody] PacienteInput input)
        {
            var repositorio = new RepositorioPaciente();

            repositorio.Atualizar(id, input.Nome, input.Cpf, input.Historico);


            return(Accepted(input));
        }
示例#9
0
        public void BD_como_atendente_devo_obter_todos_agendamentos_pelo_dia()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente    repPaciente;
            Contexto           ctx;
            ServicoAgendamento servicoAgendamento;

            //act
            ctx                = new Contexto();
            repPaciente        = new RepositorioPaciente(ctx);
            repAgendamento     = new RepositorioAgendamento(ctx);
            servicoAgendamento = new ServicoAgendamento(repAgendamento, repPaciente);

            var agendamentos = repAgendamento.obterAgendamentos(DateTime.Today.AddDays(5));

            //assert
            Assert.IsNotNull(agendamentos);
        }
示例#10
0
        public void BD_como_atendente_devo_obter_o_paciente_pedro_pelo_nome()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente    repPaciente;
            Contexto           ctx;
            ServicoAgendamento servicoAgendamento;

            //act
            ctx                = new Contexto();
            repPaciente        = new RepositorioPaciente(ctx);
            repAgendamento     = new RepositorioAgendamento(ctx);
            servicoAgendamento = new ServicoAgendamento(repAgendamento, repPaciente);

            var pacientes = repPaciente.obterPacientes("pedro");

            //assert
            Assert.AreEqual(1, pacientes.Count);
        }
示例#11
0
        public void BD_ao_abrir_a_pagina_devo_ver_os_100_primeiros_agendamentos_mais_recentes()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente    repPaciente;
            Contexto           ctx;
            ServicoAgendamento servicoAgendamento;

            //act
            ctx                = new Contexto();
            repPaciente        = new RepositorioPaciente(ctx);
            repAgendamento     = new RepositorioAgendamento(ctx);
            servicoAgendamento = new ServicoAgendamento(repAgendamento, repPaciente);

            var agendamentos = repAgendamento.obterAgendamentos();

            //assert
            Assert.IsTrue(100 == agendamentos.Count);
        }
示例#12
0
        public void BD_como_atendente_devo_obter_todos_agendamentos_do_para_daqui_a_5_dias()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente    repPaciente;
            Contexto           ctx;
            ServicoAgendamento servicoAgendamento;

            //act
            ctx                = new Contexto();
            repPaciente        = new RepositorioPaciente(ctx);
            repAgendamento     = new RepositorioAgendamento(ctx);
            servicoAgendamento = new ServicoAgendamento(repAgendamento, repPaciente);

            var agendamentos = repAgendamento.obterAgendamentos(DateTime.Today.AddDays(5));

            //assert
            Assert.AreEqual(DateTime.Today.AddDays(5).Day, agendamentos[0].DiaDoAgendamento.Day);
        }
示例#13
0
        public void BD_como_atendente_devo_obter_todos_agendamentos_do_para_daqui_a_5_dias_por_qmtDia()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente    repPaciente;
            Contexto           ctx;
            ServicoAgendamento servicoAgendamento;

            //act
            ctx                = new Contexto();
            repPaciente        = new RepositorioPaciente(ctx);
            repAgendamento     = new RepositorioAgendamento(ctx);
            servicoAgendamento = new ServicoAgendamento(repAgendamento, repPaciente);

            var agendamentos = repAgendamento.obterAgendamentos
                                   (DateTime.Today.AddDays(5), ETipoDeTratamento.Quimioterapia_Dia);

            //assert
            Assert.IsTrue(agendamentos.Count > 0);
        }
示例#14
0
 public HomeController(IConfiguration configuration)
 {
     this.configuration  = configuration;
     repositorioPaciente = new RepositorioPaciente(configuration);
 }