Ejemplo n.º 1
0
        public bool CriarAgendamento(AgendamentoViewModel agendamentoViewModel)
        {
            FabricaDeAgendamento fabricaDeAgendamento = new FabricaDeAgendamento();
            Agendamento          agendamento          = fabricaDeAgendamento.InformarCID(agendamentoViewModel.numeroCID)
                                                        .InformarMedico(agendamentoViewModel.crm)
                                                        .InformarPaciente(agendamentoViewModel.cpf)
                                                        .Criar();

            _agendamentos.Gravar(agendamento);

            EventosDoDominio.Disparar(new AgendamentoCriado(agendamentoViewModel));

            return(true);
        }
Ejemplo n.º 2
0
        public void ComoAtendenteEuQueroCriarUmAgendamento()
        {
            //arrange
            FabricaDeAgendamento fabricaDeAgendamento = new FabricaDeAgendamento();

            //act
            AgendamentoViewModel agendamentoViewModel = new AgendamentoViewModel {
                cpf = "2345", crm = "1234", numeroCID = "21-9"
            };



            ServicoDeAgendamento servicoDeAgendamento = new ServicoDeAgendamento(new AgendamentosFake());
            var retorno = servicoDeAgendamento.CriarAgendamento(agendamentoViewModel);
        }
        public void DeveCriarUmAgendamento()
        {
            //Arrange
            FabricaDeAgendamento fabricaDeAgendamento = new FabricaDeAgendamento();

            //Act
            Agendamento agendamento =
                fabricaDeAgendamento.InformarPaciente("123455")
                .InformarAtendente("1234")
                .InformarMedicoSolicitante("CRM")
                .Criar();

            //Assert
            Assert.IsTrue(agendamento.Paciente.CPF == "123455");
            Assert.IsTrue(agendamento.MedicoSolicitante.CRM == "CRM");
            Assert.IsTrue(agendamento.Atendente.CPF == "1234");
        }
Ejemplo n.º 4
0
        public void ComoDesenvolvedorQueroUmaFabricaDeAgendamento()
        {
            //arrange
            FabricaDeAgendamento fabricaDeAgendamento = new FabricaDeAgendamento();

            //act

            Agendamento agendamento =
                fabricaDeAgendamento.
                InformarPaciente("2345").
                InformarMedico("1234").
                InformarCID("21-9").
                Criar();

            //assert

            Assert.IsTrue(agendamento.Medico.Crm == "1234");
            Assert.IsTrue(agendamento.Paciente.Cpf == "2345");
            Assert.IsTrue(agendamento.Cid.Numero == "21-9");
        }
Ejemplo n.º 5
0
        public void ComoAtendenteQueroPersistirUmAgendamento()
        {
            //Arrange
            IAgendamentos agendamentos = new AgendamentosFake();

            FabricaDeAgendamento fabricaDeAgendamento = new FabricaDeAgendamento();

            //act

            Agendamento agendamento =
                fabricaDeAgendamento.
                InformarPaciente("2345").
                InformarMedico("1234").
                InformarCID("21-9").
                Criar();

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


            //Assert
            Assert.IsTrue(retorno);
        }