public async void ValidateRegister() { Assert.NotNull(m_medic, "Object not null"); Assert.AreEqual(m_medic.CRM, "123"); Assert.AreEqual(m_medic.UserId, 123); IEnumerable <Medic> medics = await m_medicService.ListAsync(); Assert.AreEqual(medics.Count(), 0); }
public async void ValidateListing() { IEnumerable <Medic> medics = await m_medicService.ListAsync(); Assert.IsNotEmpty(medics, "Patients were not listed"); Assert.AreEqual(medics.Count(), 2, "Incorrect count in the medic list"); Medic medic = medics.First(); User patientUser = await m_userService.FindByIdAsync(medic.UserId); Assert.NotNull(medic, "Medic not null"); Assert.AreEqual(patientUser.Name, "Fulano", "Different name inserted"); Assert.AreEqual(medic.CRM, "123", "Different CRM inserted"); Assert.AreEqual(medic.UserId, 1, "Different UserID inserted"); }
public async void ValidateDeleting() { IEnumerable <Medic> medics = await m_medicService.ListAsync(); Assert.AreEqual(medics.Count(), 0); }
public async Task <ActionResult <IEnumerable <Medic> > > Get() { return(Ok(await _medicService.ListAsync())); }
public async Task <ActionResult <IEnumerable <Medic> > > Get() { var medics = await _medicService.ListAsync(); return(Ok(_mapper.Map <IEnumerable <Medic>, IEnumerable <MedicDTO> >(medics))); }