public void Map_doctor_entity_to_identifier_doctor_dto_when_when_entity_is_null() { Doctor doctor = null; Assert.Throws <ArgumentNullException>(() => DoctorMapper.MapDoctorEntityToIdentifierDoctorDTO(doctor)); }
public void Map_doctor_entity_to_identifier_doctor_dto() { Doctor doctor = this.GetDoctorFirts(); IdentifiableDTO <DoctorDTO> identifierDoctorDTO = DoctorMapper.MapDoctorEntityToIdentifierDoctorDTO(doctor); Assert.True(IsEqualDoctorEntitiesAndIdentifierDoctorDTO(doctor, identifierDoctorDTO)); }
public IdentifiableDTO <DoctorDTO> GetById(Guid id) { try { return(DoctorMapper.MapDoctorEntityToIdentifierDoctorDTO(_doctorRepository.GetById(id))); }catch (ArgumentNullException e) { throw new NotFoundEntityException(); }catch (Exception e) { throw new InternalServerErrorException(); } }
public IEnumerable <IdentifiableDTO <DoctorDTO> > GetAll() { try { return(_doctorRepository.GetAll().Select(c => DoctorMapper.MapDoctorEntityToIdentifierDoctorDTO(c))); } catch (ArgumentNullException e) { throw new NotFoundEntityException(); } catch (Exception e) { throw new InternalServerErrorException(); } }