コード例 #1
0
        public void ComoAtendenteQueroInformarNoAgendamentoOPaciente()
        {
            //Arrange

            Paciente paciente = new Paciente("000.000.000-12", "Fabio Margarito Martins de Barros");

            Agendamento agendamento = (new FabricaDeAgendamento()).InformarMedico("1234", "Fabio").InformarAtendente("12345", "Joao").Criar();

            //Act
            agendamento.InformarPaciente(paciente);

            //Assert
            Assert.IsTrue(agendamento.Paciente.CPF == "000.000.000-12");
        }
コード例 #2
0
        public void ComoAtendenteQueroInformarNoAgendamentoOPaciente()
        {
            //Arrange

            Medico      medico      = new Medico("1234", "Mario Peres");
            Atendente   atendente   = new Atendente("000.000.000-10", "Victor Cleber");
            Paciente    paciente    = new Paciente("000.000.000-12", "Fabio Margarito Martins de Barros");
            Agendamento agendamento = new Agendamento(atendente, medico);

            //Act
            agendamento.InformarPaciente(paciente);


            //Assert
            Assert.IsTrue(agendamento.Paciente.CPF == "000.000.000-12");
        }
コード例 #3
0
        public void ComoAtendenteEuQueroCadastrarUmAgendamento()
        {
            //Arrange

            ServicoDeAgendamento servicoDeAgendamento = new ServicoDeAgendamento();
            Medico      medico      = new Medico("1234", "Mario Peres");
            Atendente   atendente   = new Atendente("000.000.000-10", "Victor Cleber");
            Agendamento agendamento = new Agendamento(atendente, medico);

            //Act
            bool retorno = servicoDeAgendamento.CadastrarAgendamento(agendamento);

            //Assert

            Assert.IsTrue(retorno);
        }
コード例 #4
0
        public void ComoAtendenteEuQueroCadastrarUmAgendamento()
        {
            //Arrange

            ServicoDeAgendamento servicoDeAgendamento = new ServicoDeAgendamento(new AgendamentosFake());
            Medico      medico      = new Medico("1234", "Mario Peres");
            Atendente   atendente   = new Atendente("000.000.000-10", "Victor Cleber");
            Agendamento agendamento = (new FabricaDeAgendamento()).InformarMedico("1234", "Fabio").InformarAtendente("12345", "Joao").Criar();

            //Act
            bool retorno = servicoDeAgendamento.CadastrarAgendamento(agendamento);

            //Assert

            Assert.IsTrue(retorno);
        }
コード例 #5
0
        public void ComoAtendenteQueroInformaroNoAgendamentoOCID()
        {
            //Arrange
            //Arrange

            Agendamento agendamento = (new FabricaDeAgendamento()).InformarAtendente("12345", "Joao").InformarMedico("1234", "Fabio").Criar();

            CID cid = new CID("A00 - Cólera");


            //Act
            agendamento.InformarCID(cid);


            //Assert
            Assert.IsTrue(agendamento.CID.Descricao == "A00 - Cólera");
        }
コード例 #6
0
        public void ComoAtendenteQueroInformarOExameDesejadoNoAgendamento()
        {
            //Arrange

            Medico            medico            = new Medico("1234", "Mario Peres");
            Atendente         atendente         = new Atendente("000.000.000-10", "Victor Cleber");
            Agendamento       agendamento       = new Agendamento(atendente, medico);
            TipoExame         tipoExame         = new TipoExame("0001110000111212", 10);
            CentroDiagnostico centroDiagnostico = new CentroDiagnostico("111.222.333/00001-11");
            Exame             exame             = new Exame(tipoExame, centroDiagnostico, new DateTime(2015, 02, 20));

            //Act
            agendamento.AdicionarExame(exame);


            //Assert
            Assert.IsTrue(agendamento.Exames.FirstOrDefault().TipoExame.CBHPM == "0001110000111212");
        }
コード例 #7
0
        public void ComoAtendenteQueroInformaroNoAgendamentoOCID()
        {
            //Arrange
            //Arrange

            Medico      medico      = new Medico("1234", "Mario Peres");
            Atendente   atendente   = new Atendente("000.000.000-10", "Victor Cleber");
            Agendamento agendamento = new Agendamento(atendente, medico);
            CID         cid         = new CID("A00 - Cólera");


            //Act
            agendamento.InformarCID(cid);


            //Assert
            Assert.IsTrue(agendamento.CID.Descricao == "A00 - Cólera");
        }
コード例 #8
0
        public void ComoAtendenteQueroInformarOExameDesejadoNoAgendamentoIntegrado()
        {
            //Arrange

            Agendamento agendamento = (new FabricaDeAgendamento()).InformarMedico("1234", "Fabio").InformarAtendente("12345", "Joao").Criar();

            TipoExame         tipoExame         = new TipoExame("0001110000111212", 10);
            CentroDiagnostico centroDiagnostico = new CentroDiagnostico("111.222.333/00001-11");
            Exame             exame             = new Exame(tipoExame, centroDiagnostico, new DateTime(2015, 02, 20));

            //Act
            agendamento.AdicionarExame(exame);
            (new ServicoDeAgendamento(new Agendamentos(_session))).CadastrarAgendamento(agendamento);


            //Assert
            Assert.IsTrue(agendamento.Exames.FirstOrDefault().TipoExame.CBHPM == "0001110000111212");
        }
コード例 #9
0
        public void ComoMedicoQueroEmitirUmLaudoParaUmTipoExameRealizado()
        {
            //Arrange
            Agendamento agendamento = (new FabricaDeAgendamento()).InformarMedico("1234", "Fabio").InformarAtendente("12345", "Joao").Criar();


            TipoExame         tipoExame         = new TipoExame("0001110000111212", 10);
            CentroDiagnostico centroDiagnostico = new CentroDiagnostico("111.222.333/00001-11");
            Exame             exame             = new Exame(tipoExame, centroDiagnostico, new DateTime(2015, 02, 20));

            agendamento.AdicionarExame(exame);

            //Act
            agendamento.Exames.FirstOrDefault().EmitirLaudo("Resultado XPTO", new Medico("123", "Jose"));

            //Assert
            Assert.IsTrue(agendamento.Exames.FirstOrDefault().Laudo.Resultado == "Resultado XPTO");
        }
コード例 #10
0
        public void ComoMedicoQueroEmitirUmLaudoParaUmTipoExameRealizado()
        {
            //Arrange

            Medico            medico            = new Medico("1234", "Mario Peres");
            Atendente         atendente         = new Atendente("000.000.000-10", "Victor Cleber");
            Agendamento       agendamento       = new Agendamento(atendente, medico);
            TipoExame         tipoExame         = new TipoExame("0001110000111212", 10);
            CentroDiagnostico centroDiagnostico = new CentroDiagnostico("111.222.333/00001-11");
            Exame             exame             = new Exame(tipoExame, centroDiagnostico, new DateTime(2015, 02, 20));

            agendamento.AdicionarExame(exame);

            //Act
            agendamento.Exames.FirstOrDefault().EmitirLaudo("Resultado XPTO", new Medico("123", "Jose"));

            //Assert
            Assert.IsTrue(agendamento.Exames.FirstOrDefault().Laudo.Resultado == "Resultado XPTO");
        }
コード例 #11
0
        public void ComoAtendenteQueroCalcularOValorTotalDoAgendamento()
        {
            //Arrange

            Agendamento       agendamento       = (new FabricaDeAgendamento()).InformarMedico("1234", "Fabio").InformarAtendente("12345", "Joao").Criar();
            TipoExame         tipoExame         = new TipoExame("0001110000111212", 10);
            CentroDiagnostico centroDiagnostico = new CentroDiagnostico("111.222.333/00001-11");
            Exame             exame             = new Exame(tipoExame, centroDiagnostico, new DateTime(2015, 02, 20));

            agendamento.AdicionarExame(exame);
            agendamento.AdicionarExame(exame);

            //Act
            var retorno = agendamento.CalcularValorTotal();

            //Assert

            Assert.IsTrue(retorno == 20);
        }
コード例 #12
0
        public void ComoAtendenteQueroCalcularOValorTotalDoAgendamento()
        {
            //Arrange

            Medico            medico            = new Medico("1234", "Mario Peres");
            Atendente         atendente         = new Atendente("000.000.000-10", "Victor Cleber");
            Agendamento       agendamento       = new Agendamento(atendente, medico);
            TipoExame         tipoExame         = new TipoExame("0001110000111212", 10);
            CentroDiagnostico centroDiagnostico = new CentroDiagnostico("111.222.333/00001-11");
            Exame             exame             = new Exame(tipoExame, centroDiagnostico, new DateTime(2015, 02, 20));

            agendamento.AdicionarExame(exame);
            agendamento.AdicionarExame(exame);

            //Act
            var retorno = agendamento.CalcularValorTotal();

            //Assert

            Assert.IsTrue(retorno == 20);
        }
コード例 #13
0
 public bool Gravar(Agendamento agendamento)
 {
     _session.SaveOrUpdate(agendamento);
     _session.Flush();
     return(true);
 }