Ejemplo n.º 1
0
        public void Map_specialization_collection_to_identifier_specialization_collection_when_collection_is_null()
        {
            List <Specialization> listOfSpecializations = null;

            Assert.Throws <ArgumentNullException>(()
                                                  => SpecializationMapper.MapSpecializationEntityCollectionToSpecializationIdentifierDTOCollection(listOfSpecializations));
        }
Ejemplo n.º 2
0
 public IEnumerable <IdentifiableDTO <SpecializationDTO> > GetAll()
 {
     try
     {
         return(SpecializationMapper.MapSpecializationEntityCollectionToSpecializationIdentifierDTOCollection(_specializationRepository.GetAll()));
     }
     catch (ArgumentNullException)
     {
         throw new NotFoundEntityException();
     }
     catch (Exception)
     {
         throw new InternalServerErrorException();
     }
 }
Ejemplo n.º 3
0
        public void Map_specialization_collection_to_identifier_specialization_collection()
        {
            Guid                  idFirst              = Guid.Parse("11ac21e1-1361-4c06-9751-9666ce10d30a");
            Specialization        specializationFirst  = new Specialization(idFirst, "Hirurg");
            Guid                  idSecond             = Guid.Parse("c389f917-3eb8-4f1a-a22c-bbc34b137f69");
            Specialization        specializationSecond = new Specialization(idSecond, "Oftamolog");
            List <Specialization> listOfSpecialization = new List <Specialization>();

            listOfSpecialization.Add(specializationFirst);
            listOfSpecialization.Add(specializationSecond);

            List <IdentifiableDTO <SpecializationDTO> > listOfIdentifierSpecializations = SpecializationMapper.MapSpecializationEntityCollectionToSpecializationIdentifierDTOCollection(listOfSpecialization).ToList();

            Assert.Equal(listOfIdentifierSpecializations[0].Id, specializationFirst.Id);
            Assert.Equal(listOfIdentifierSpecializations[0].EntityDTO.Name, specializationFirst.Name);
            Assert.Equal(listOfIdentifierSpecializations[1].Id, specializationSecond.Id);
            Assert.Equal(listOfIdentifierSpecializations[1].EntityDTO.Name, specializationSecond.Name);
        }