public virtual void AdicionarExame(Exame exame)
        {
            if(exame ==null)
                throw new Exception("É necessário informar um exame válido");

            (Exames as IList<Exame>).Add(exame);
        }
Ejemplo n.º 2
0
        public virtual void AdicionarExame(Exame exame)
        {
            if (exame == null)
            {
                throw new Exception("É necessário informar um exame válido");
            }

            (Exames as IList <Exame>).Add(exame);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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");
        }
Ejemplo n.º 5
0
        public void ComoAtendenteQueroInformarOExameDesejadoNoAgendamento()
        {
            //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 AgendamentosFake())).CadastrarAgendamento(agendamento);

               //Assert
            Assert.IsTrue(agendamento.Exames.FirstOrDefault().TipoExame.CBHPM == "0001110000111212");
        }