public async Task DeveRetornarFalsoAoVerificarSeConsultaExiste() { //Arrange var consulta = new Domain.BusinessObject.Consulta { Beneficiario = new Beneficiario { }, Medico = new Medico { Crm = "123", Nome = "Medico 1" }, Data = new DateTime(2016, 10, 10, 10, 00, 00) }; //Action var consultaExists = await this.servicoMarcarConsulta.ConsultaExists(consulta); //Assert Assert.IsFalse(consultaExists); }
public async Task DeveInserirConsulta() { //Arrange var consulta = new Domain.BusinessObject.Consulta { Id = 4, Beneficiario = new Beneficiario { }, Medico = new Medico { Crm = "123", Nome = "Medico 1" }, Data = new DateTime(2016, 10, 10, 10, 00, 00) }; //Action await this.servicoMarcarConsulta.MarcarConsulta(consulta); //Assert var consultaInserida = this.consultaRepository.Find(c => c.Id == consulta.Id); Assert.IsNotNull(consultaInserida); }
public async Task Save(Domain.BusinessObject.Consulta entity) { await Task.Factory.StartNew(() => this.consultas.Add(entity)); }