Esempio n. 1
0
        public void Mock_como_atendente_devo_obter_todos_agendamentos_do_para_daqui_a_5_dias()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente repPaciente;
            ServicoAgendamento servicoAgendamento;
            //act
            repPaciente = new RepositorioPacienteMock();
            repAgendamento = new RepositorioAgendamentoMock(repPaciente);
            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);
        }
Esempio n. 2
0
        public void Mock_como_atendente_devo_obter_o_paciente_pedro_pelo_nome()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente repPaciente;
            ServicoAgendamento servicoAgendamento;
            //act
            repPaciente = new RepositorioPacienteMock();
            repAgendamento = new RepositorioAgendamentoMock(repPaciente);
            servicoAgendamento = new ServicoAgendamento(repAgendamento, repPaciente);

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

            //assert
            Assert.AreEqual(1, pacientes.Count);
        }
Esempio n. 3
0
        public void Mock_como_atendente_devo_obter_todos_agendamentos_do_para_daqui_a_5_dias_por_qmtDia()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente repPaciente;
            ServicoAgendamento servicoAgendamento;
            //act
            repPaciente = new RepositorioPacienteMock();
            repAgendamento = new RepositorioAgendamentoMock(repPaciente);
            servicoAgendamento = new ServicoAgendamento(repAgendamento, repPaciente);

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

            //assert
            Assert.AreEqual(9,agendamentos.Count);
        }
Esempio n. 4
0
        public void Mock_como_atendente_devo_obter_todos_agendamentos_do_para_daqui_a_5_dias()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente    repPaciente;
            ServicoAgendamento      servicoAgendamento;

            //act
            repPaciente        = new RepositorioPacienteMock();
            repAgendamento     = new RepositorioAgendamentoMock(repPaciente);
            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);
        }
Esempio n. 5
0
        public void Mock_como_atendente_devo_obter_todos_agendamentos_pelo_dia()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente    repPaciente;
            ServicoAgendamento      servicoAgendamento;

            //act
            repPaciente        = new RepositorioPacienteMock();
            repAgendamento     = new RepositorioAgendamentoMock(repPaciente);
            servicoAgendamento = new ServicoAgendamento(repAgendamento, repPaciente);

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

            //assert
            Assert.IsNotNull(agendamentos);
        }
Esempio n. 6
0
        public void Mock_como_atendente_devo_obter_o_paciente_pedro_pelo_nome()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente    repPaciente;
            ServicoAgendamento      servicoAgendamento;

            //act
            repPaciente        = new RepositorioPacienteMock();
            repAgendamento     = new RepositorioAgendamentoMock(repPaciente);
            servicoAgendamento = new ServicoAgendamento(repAgendamento, repPaciente);

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

            //assert
            Assert.AreEqual(1, pacientes.Count);
        }
Esempio n. 7
0
        public void Mock_como_atendente_devo_obter_todos_agendamentos_do_para_daqui_a_5_dias_por_qmtDia()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente    repPaciente;
            ServicoAgendamento      servicoAgendamento;

            //act
            repPaciente        = new RepositorioPacienteMock();
            repAgendamento     = new RepositorioAgendamentoMock(repPaciente);
            servicoAgendamento = new ServicoAgendamento(repAgendamento, repPaciente);

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

            //assert
            Assert.AreEqual(9, agendamentos.Count);
        }
Esempio n. 8
0
        public void Mock_como_atendente_devo_registrar_um_agendamento()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente    repPaciente;
            ServicoAgendamento      servicoAgendamento;

            //act
            repPaciente        = new RepositorioPacienteMock();
            repAgendamento     = new RepositorioAgendamentoMock(repPaciente);
            servicoAgendamento = new ServicoAgendamento(repAgendamento, repPaciente);

            var paciente    = repPaciente.obterPaciente("1");
            var data        = DateTime.Now.AddDays(5);
            var agendamento = new Agendamento(paciente, data, ETipoDeTratamento.Quimioterapia_Dia);
            var funfou      = servicoAgendamento.registrarAgendamento(agendamento);

            //assert
            Assert.IsTrue(funfou);
        }
Esempio n. 9
0
        public void Mock_como_atendente_devo_obter_todos_agendamentos_pelo_dia()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente repPaciente;
            ServicoAgendamento servicoAgendamento;
            //act
            repPaciente = new RepositorioPacienteMock();
            repAgendamento = new RepositorioAgendamentoMock(repPaciente);
            servicoAgendamento = new ServicoAgendamento(repAgendamento, repPaciente);

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

            //assert
            Assert.IsNotNull(agendamentos);
        }
Esempio n. 10
0
        public void Mock_como_atendente_devo_registrar_um_agendamento_e_obter_o_mesmo_agendamento()
        {
            //arrenge
            IRepositorioAgendamento repAgendamento;
            IRepositorioPaciente repPaciente;
            ServicoAgendamento servicoAgendamento;
            //act
            repPaciente = new RepositorioPacienteMock();
            repAgendamento = new RepositorioAgendamentoMock(repPaciente);
            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));
        }