public void CriarAgendamento(Paciente paciente, Medico medicoSolicitante) { ValidarDadosParaCriacaoDoExame(paciente, medicoSolicitante); Paciente = paciente; MedicoSolicitante = medicoSolicitante; }
static void Main(string[] args) { List<PlanoDeSaudeBase> planosDeSaude = new List<PlanoDeSaudeBase>(); planosDeSaude.Add(new PlanoDePreventSenior{CNPJ = "002.002.0002/00002-20" }); planosDeSaude.Add(new PlanoDeSaudeAmil{CNPJ = "003.003.0003/00003-30"}); planosDeSaude.Add(new PlanoDeSaudePortoSeguro{CNPJ= "004.004.0004/00004-40"}); planosDeSaude.Add(new PlanoDeSaudeSulAmerica{CNPJ="005.005.0005/00005-50"}); planosDeSaude.Add(new PlanoDeSaudeBradesco{CNPJ = "006.006.0006/00006-0"}); Paciente paciente = new Paciente("Fabio Margarito", "294.3434.3434"); paciente.DefinirPlanoDeSaude((new FabricaDePlanos(planosDeSaude)).RetornarPlanoPorCNPJ("006.006.0006/00006-0")); ServicoDePagamento servicoDePagamento = new ServicoDePagamentoVisa(); servicoDePagamento.ClienteVIP = true; servicoDePagamento.RealizarPagamento(new Cartao("1234","fabio","123"),100 ); Console.ReadKey(); }
public void CriarAgendamento(Paciente paciente, Medico medicoSolicitante) { ValidarDadosDoAgendamento(paciente,medicoSolicitante); Paciente = paciente; MedicoSolicitante = medicoSolicitante; }
private void ValidarDadosDoAgendamento(Paciente paciente, Medico medicoSolicitante) { if (paciente ==null) throw new ArgumentNullException("Paciente inválido"); if (medicoSolicitante == null) throw new ArgumentException("Médico Inválido"); }
public List<Paciente> RetornarPorTrechoNome(string fa) { List<Paciente> pacientes = new List<Paciente>(); Paciente paciente = new Paciente("Fabio Margarito","123434535"); pacientes.Add(paciente); return pacientes; }
public bool Excluir(Paciente paciente) { _sessao.Delete(paciente); _sessao.Flush(); return true; }
public bool Gravar(Paciente paciente) { _sessao.SaveOrUpdate(paciente); _sessao.Flush(); return true; }
private void ValidarDadosParaCriacaoDoExame(Paciente paciente, Medico medicoSolicitante) { if (string.IsNullOrEmpty(paciente.CPF)) throw new ArgumentNullException("Paciente inválido"); if (string.IsNullOrEmpty(medicoSolicitante.CRM)) throw new ArgumentException("Médico Inválido"); }
public void CriarAgendamento(Paciente paciente, Medico medicoSolicitante) { if (string.IsNullOrEmpty(paciente.CPF)) throw new ArgumentNullException("Paciente inválido"); if (string.IsNullOrEmpty(medicoSolicitante.CRM)) throw new ArgumentException("Médico Inválido"); Paciente = paciente; MedicoSolicitante = medicoSolicitante; }
public void ValidarGeracaoDeCredencial() { //Arrange Credencial credencial = new Credencial(); Paciente paciente = new Paciente("Fabio Margarito","123456"); //Act var retorno = credencial.GerarCredencial(paciente); //Assert Assert.IsTrue(retorno.NomeDeUsuario =="Fabio123456"); Assert.IsTrue(retorno.Senha == "123456"); }
public bool Gravar(PacienteViewModel paciente) { PlanoDeSaude planoDeSaude = new PlanoDeSaude("1234", "Teste", "Tipo Plano"); Credencial credencial = new Credencial("Fabio","FabioCPF"); Paciente pacient = new Paciente(paciente.Nome,paciente.Cpf); pacient.DefinirPlanoDeSaude(planoDeSaude); pacient.DefinirCredencial(credencial); return _repositorioPaciente.Gravar(pacient); }
public void DeveExcluirUmPaciente() { //Arrange IRepositorioPaciente repositorioPaciente = new RepositorioPacienteFake(); Paciente paciente = new Paciente("Fabio Margarito","23434343"); //Act var retorno = repositorioPaciente.Excluir(paciente); //Assert Assert.IsTrue(retorno); }
public void DeveGravarUmPaciente() { //Arrange IRepositorio<Paciente> repositorioPaciente = new RepositorioPacienteMock(); //Act Paciente paciente = new Paciente("fabio", "1234"); paciente.DefinirPlanoDeSaude(new PlanoDeSaude()); var retorno = repositorioPaciente.Gravar(paciente); //Assert Assert.IsTrue(retorno); }
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 ComoAtendenteQueroCriarUmaCredencialParaUmPaciente() { //Arrange Credencial objetoCredencial = new Credencial(); Paciente paciente = new Paciente("Fabio Margarito Martins de Barros", "34554323423"); //Act Credencial credencial = objetoCredencial.GerarCredencialInicial(paciente); //Assert Assert.IsTrue(credencial.NomeDeUsuario == "Fabio34554323423"); Assert.IsTrue(credencial.Senha == "34554323423"); }
public void DeveGravarUmPacienteNaBaseIntegrado() { UnityContainer unityContainer = new UnityContainer(); unityContainer.RegisterType<IRepositorioPaciente, RepositorioPaciente>(); unityContainer.RegisterInstance<ISession>(ConfiguracaoNHibernate.Criar().OpenSession()); //Arrange Paciente paciente = new Paciente("Fabio Margarito Martins de Barros", "12345623423"); IRepositorioPaciente repositorioPaciente = unityContainer.Resolve<IRepositorioPaciente>(); //Act var retorno = repositorioPaciente.Gravar(paciente); //Assert Assert.IsTrue(retorno); }
public void DeveExcluirUmPacienteIntegrado() { UnityContainer unityContainer = new UnityContainer(); unityContainer.RegisterType<IRepositorioPaciente, RepositorioPaciente>(); unityContainer.RegisterInstance<ISession>(ConfiguracaoNHibernate.Criar().OpenSession()); //Arrange IRepositorioPaciente repositorioPaciente = unityContainer.Resolve<IRepositorioPaciente>(); Paciente paciente = new Paciente("Fabio Margarito", "23434343"); //Act var retorno = repositorioPaciente.Excluir(paciente); //Assert Assert.IsTrue(retorno); }
static void Main(string[] args) { ISessaoORM<ISessionFake> sessao = new SessaoFake(); //Cria a caixa d'agua, que chamamos de container UnityContainer unityContainer = new UnityContainer(); //encher a caixa d'agua, que chamados de registrar os componentes unityContainer.RegisterInstance(sessao); unityContainer.RegisterType<IRepositorio<Paciente>, PacientesFake>(); unityContainer.RegisterType<IRepositorio<Cartao>, RepositorioCartao>(); Paciente paciente = new Paciente("fabio", Guid.NewGuid().ToString()) {Apelido = "teste"}; IRepositorio<Paciente> pacientes = unityContainer.Resolve<IRepositorio<Paciente>>(); pacientes.Gravar(paciente); var retorno = pacientes.RetornarTodos(); pacientes.Dispose(); Console.Write("Consultas e gravações!!!!"); Console.ReadKey(); }
public bool Gravar(Paciente paciente) { return true; }
public bool Excluir(Paciente paciente) { return true; }