public IActionResult Get() { var paciente = new RepositorioPaciente(); var lista = paciente.ObterPacientes(); return(Ok(lista)); }
public IActionResult Get(int id) { var repositorio = new RepositorioPaciente(); var paciente = repositorio.ObterPaciente(id); return(Ok(paciente)); }
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)); }
public AgendamentoForm() { InitializeComponent(); repoMedico = new RepositorioMedico(); repoConsulta = new RepositorioConsulta(); repoPaciente = new RepositorioPaciente(); }
public PacientesForm() { InitializeComponent(); // Inicializa o repositório: repo = new RepositorioPaciente(); }
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)); }
public IActionResult Delete(int id) { var repositorio = new RepositorioPaciente(); repositorio.Excluir(id); return(Ok()); }
public IActionResult Put(int id, [FromBody] PacienteInput input) { var repositorio = new RepositorioPaciente(); repositorio.Atualizar(id, input.Nome, input.Cpf, input.Historico); return(Accepted(input)); }
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); }
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); }
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); }
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); }
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); }
public HomeController(IConfiguration configuration) { this.configuration = configuration; repositorioPaciente = new RepositorioPaciente(configuration); }