public void ComoAtendenteEuQueroCriarUmAgendamento() { //Arrange AgendamentoViewModel agendamentoViewModel = new AgendamentoViewModel {crm= "2345", cpf= "2345", numeroCID = "21-9" }; //Act ServicoDeAgendamento servicoDeAgendamento = new ServicoDeAgendamento(new AgendamentosFake()); var retorno = servicoDeAgendamento.CriarAgendamento(agendamentoViewModel); Assert.IsTrue(retorno); }
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; }