public DataReaderMapper_ADataReaderToADtoWithNullableField()
        {
            Mapper.Initialize(cfg =>
            {
                MapperRegistry.Mappers.Insert(0, new DataReaderMapper());
                cfg.CreateMap <IDataReader, DtoWithSingleNullableField>();
            });

            _dataReader = new DataBuilder().BuildDataReaderWithNullableField();
        }
        public DataReaderMapper_ASingleDataRecordToADto()
        {
            Mapper.Initialize(cfg =>
            {
                MapperRegistry.Mappers.Insert(0, new DataReaderMapper());
                cfg.CreateMap <IDataRecord, DtoObject>()
                .ForMember(dest => dest.Else, options => options.MapFrom(src => src.GetDateTime(src.GetOrdinal(FieldName.Something))));
            });

            _dataRecord = new DataBuilder().BuildDataRecord();
            _result     = Mapper.Map <IDataRecord, DtoObject>(_dataRecord);
        }
        public DataReaderMapper_ADataReaderToADto()
        {
            Mapper.Initialize(cfg =>
            {
                MapperRegistry.Mappers.Insert(0, new DataReaderMapper { YieldReturnEnabled = YieldReturnEnabled });
                cfg.CreateMap<IDataReader, DtoObject>()
                    .ForMember(dest => dest.Else, options => options.MapFrom(src => src.GetDateTime(10)));
            });

            DataReader = new DataBuilder().BuildDataReader();
            Results = Mapper.Map<IDataReader, IEnumerable<DtoObject>>(DataReader);
            Result = Results.FirstOrDefault();
        }
        public DataReaderMapper_ADataReaderToADto()
        {
            Mapper.Initialize(cfg =>
            {
                MapperRegistry.Mappers.Insert(0, new DataReaderMapper {
                    YieldReturnEnabled = YieldReturnEnabled
                });
                cfg.CreateMap <IDataReader, DtoObject>()
                .ForMember(dest => dest.Else, options => options.MapFrom(src => src.GetDateTime(10)));
            });

            DataReader = new DataBuilder().BuildDataReader();
            Results    = Mapper.Map <IDataReader, IEnumerable <DtoObject> >(DataReader);
            Result     = Results.FirstOrDefault();
        }
 public DataReaderMapper_ADataReaderToADtoTwice()
 {
     DataReader = new DataBuilder().BuildDataReader();
     Results = Mapper.Map<IDataReader, IEnumerable<DtoObject>>(DataReader);
     Result = Results.FirstOrDefault();
 }
 public DataReaderMapper_ADataReaderToADtoAndTheMapDoesNotExist()
 {
     Mapper.Initialize(cfg => MapperRegistry.Mappers.Insert(0, new DataReaderMapper()));
     _dataReader = new DataBuilder().BuildDataReader();
 }
 public DataReaderMapper_ADataReaderToADtoTwice()
 {
     DataReader = new DataBuilder().BuildDataReader();
     Results    = Mapper.Map <IDataReader, IEnumerable <DtoObject> >(DataReader);
     Result     = Results.FirstOrDefault();
 }