static void Main(string[] args)
        {

            Agendamento agendamento = new Agendamento(123,new Paciente("123","Fabio"),new Atendente("1234","fabio")); 
            agendamento.AdicionarExame(new Exame());

        }
Esempio n. 2
0
        public FabricaDeAgendamento InformarExame(string codigo, string descricao, double preco)
        {
            TipoExame tipoExame = new TipoExame(codigo, descricao);
            Exame     exame     = new Exame(Guid.NewGuid(), tipoExame, preco);

            _Agendamento.AdicionarExame(exame);

            return(this);
        }
Esempio n. 3
0
        public Agendamento pesquisarPorPaciente(Credencial credencial)
        {
            Agendamento agendamento =
                (new FabricaDeAgendamento()).InformarPaciente("123")
                .InformarMedicoSolicitante("12345")
                .InformarAtendente("12345")
                .Criar();

            agendamento.AdicionarExame(new Exame(new TipoExame("1234", "sangue", 120)));
            agendamento.Exames.First().EmitirLaudo(new Laudo("teste"));

            return(agendamento);
        }
        public void DeveAdicionarUmExame()
        {
            //arrange
            Agendamento agendamento = new Agendamento();
            Paciente    paciente    = new Paciente("Fabio", "123");

            paciente.DefinirPlanoDeSaude(new PlanoDeSaude());

            //act
            agendamento.CriarAgendamento(paciente, new Medico("Joao", "1234", "1M"));
            agendamento.AdicionarExame(new Exame(new TipoExame("exame 1"), new DateTime(2014, 10, 06)));

            //assert
            Assert.IsTrue(agendamento.Exames.Count > 0);
        }
        public void DevePersistirOAgendamento()
        {
            //Arrage
            Agendamento agendamento =
                (new FabricaDeAgendamento()).InformarPaciente("123")
                .InformarMedicoSolicitante("1234")
                .InformarAtendente("1234")
                .Criar();

            agendamento.AdicionarExame(new Exame(new TipoExame("10101012", "Hemograma", 100)));

            IAgendamentos agendamentos = new AgendamentosFake();

            //Act
            var retorno = agendamentos.Gravar(agendamento);

            //Assert
            Assert.IsTrue(retorno);
        }
        public void ComoAtendenteQueroVerificarOValorTotalDoAgendamento()
        {
            //Arrage
            Agendamento agendamento =
                (new FabricaDeAgendamento()).InformarPaciente("123")
                .InformarMedicoSolicitante("1234")
                .InformarAtendente("1234")
                .Criar();

            agendamento.AdicionarExame(new Exame(new TipoExame("10101012", "Hemograma", 100)));

            //Act
            ServicoDeAgendamento servicoDeAgendamento = new ServicoDeAgendamento(new ServicoDeGeracaoCredencial());
            var retornoAgendamento = servicoDeAgendamento.CadastrarAgendamento(agendamento);


            //Assert
            Assert.IsTrue(agendamento.CalcularValorTotal() == 100);
        }
        public void ComoAtendenteQueroRealizarCadastrarUmAgendamento()
        {
            //Arrage
            Agendamento agendamento =
                (new FabricaDeAgendamento()).InformarPaciente("123")
                .InformarMedicoSolicitante("1234")
                .InformarAtendente("1234")
                .Criar();

            agendamento.AdicionarExame(new Exame(new TipoExame("10101012", "Hemograma", 100)));

            //Act
            ServicoDeAgendamento servicoDeAgendamento = new ServicoDeAgendamento(new ServicoDeGeracaoCredencial());
            var retornoAgendamento = servicoDeAgendamento.CadastrarAgendamento(agendamento);



            //Assert
            Assert.IsTrue(retornoAgendamento.Exames.Count() > 0);
        }
        public void ComoMedicoDeDiagnosticoQueroEmitirUmLaudoParaUmExame()
        {
            //Arrage
            Agendamento agendamento =
                (new FabricaDeAgendamento()).InformarPaciente("123")
                .InformarMedicoSolicitante("1234")
                .InformarAtendente("1234")
                .Criar();

            agendamento.AdicionarExame(new Exame(new TipoExame("10101012", "Hemograma", 100)));

            //Act
            ServicoDeAgendamento servicoDeAgendamento = new ServicoDeAgendamento(new ServicoDeGeracaoCredencial());
            var retornoAgendamento = servicoDeAgendamento.CadastrarAgendamento(agendamento);

            agendamento.Exames.FirstOrDefault().EmitirLaudo(new Laudo("bla bla bla bla"));

            //Assert
            Assert.IsTrue(agendamento.Exames.FirstOrDefault().Laudo.Descricao == "bla bla bla bla");
        }
Esempio n. 9
0
        public void ComoAtendenteQueroIncluirUmExameDoPaciente()
        {
            //Arrange
            Agendamento agendamento = new Agendamento();
            Medico      medico      = new Medico("12345", "Fabio");
            Paciente    paciente    = new Paciente("2345", "Joao");
            CID         cid         = new CID("21-9", "Virose");

            Exame exame = new Exame("12342323232");


            //Act
            agendamento.InformarMedico(medico);
            agendamento.InformarCID(cid);
            agendamento.InformarPaciente(paciente);
            agendamento.AdicionarExame(exame);


            //Assert
            Assert.IsTrue(agendamento.Medico.Crm == "12345");
            Assert.IsTrue(agendamento.Paciente.Cpf == "2345");
            Assert.IsTrue(agendamento.Cid.Numero == "21-9");
            Assert.IsTrue(agendamento.Exames.Any());
        }