Example #1
0
        public void GetTourTypeById_stringValueReturned()
        {
            var mock = new Mock <IUnitOfWork>();

            mock.Setup(m => m.TourTypes.Get(1)).Returns(types.ElementAt(0));
            var             mapper  = new MapperConfiguration(cfg => cfg.CreateMap <TourType, TourTypeDTO>()).CreateMapper();
            TourTypeService country = new TourTypeService(mock.Object);

            //ISerialize<TourTypeDTO> serialize = new TourTypeSerialize();
            TourTypeDTO example = (mapper.Map <TourType, TourTypeDTO>(types.ElementAt(0)));//serialize.serializeVary

            TourTypeDTO data = country.GetTourType(1);

            Assert.IsNotNull(data);
        }
Example #2
0
        async Task <TourTypeDTO> IService <TourTypeDTO, int> .Update(TourTypeDTO entity)
        {
            TourType tourType = await _tourTypeRepository.Update(_mapper.Map <TourTypeDTO, TourType>(entity));

            return(_mapper.Map <TourType, TourTypeDTO>(tourType));
        }