예제 #1
0
 public void EditCompoundParameters(IEnumerable <IParameter> compoundParameters)
 {
     _compoundTypeParameters = compoundParameters.Where(x => string.Equals(x.GroupName, CoreConstants.Groups.COMPOUND_PKA)).ToList();
     _parameterCache         = new PathCache <IParameter>(_entityPathResolver).For(_compoundTypeParameters);
     _compoundTypeDTO        = _dtoMapper.MapFrom(_compoundTypeParameters);
     _view.BindTo(_compoundTypeDTO.AllTypePKas);
     _editValueOriginPresenter.Edit(_compoundTypeParameters.FirstOrDefault());
 }
예제 #2
0
        public void EditCompoundParameters(IEnumerable <IParameter> compoundParameters)
        {
            var parameters = compoundParameters.ToList();

            _compoundTypeDTO = _dtoMapper.MapFrom(parameters);
            _parameterCache  = new PathCache <IParameter>(_entityPathResolver).For(parameters);
            _view.BindTo(_compoundTypeDTO.AllTypePKas);
        }
        public CompoundTypeDTO MapFrom(IEnumerable <IParameter> compoundParameters)
        {
            var allCompoundParameters      = compoundParameters.ToList();
            var compoundTypeAlternativeDTO = new CompoundTypeDTO();

            compoundTypeAlternativeDTO.AddTypePKa(typePKaFor(allCompoundParameters, CoreConstants.Parameters.PARAMETER_PKA1, CoreConstants.Parameters.COMPOUND_TYPE1));
            compoundTypeAlternativeDTO.AddTypePKa(typePKaFor(allCompoundParameters, CoreConstants.Parameters.PARAMETER_PKA2, CoreConstants.Parameters.COMPOUND_TYPE2));
            compoundTypeAlternativeDTO.AddTypePKa(typePKaFor(allCompoundParameters, CoreConstants.Parameters.PARAMETER_PKA3, CoreConstants.Parameters.COMPOUND_TYPE3));
            return(compoundTypeAlternativeDTO);
        }
예제 #4
0
        private void addTypePKaFor(CompoundTypeDTO compoundTypeDTO, IList <IParameter> compoundParameters, string parameterPka1, string parameterCompoundType1)
        {
            var pKaParameter          = compoundParameters.FindByName(parameterPka1);
            var compoundTypeParameter = compoundParameters.FindByName(parameterCompoundType1);
            var typePKaDTO            = new TypePKaDTO();

            typePKaDTO.CompoundTypeParameter = _parameterMapper.MapFrom(compoundTypeParameter, typePKaDTO, x => x.CompoundTypeValue, x => x.CompoundTypeParameter);
            typePKaDTO.PKaParameter          = _parameterMapper.MapFrom(pKaParameter, typePKaDTO, x => x.PKa, x => x.PKaParameter);
            compoundTypeDTO.AddTypePKa(typePKaDTO);
        }
예제 #5
0
        public CompoundTypeDTO MapFrom(IEnumerable <IParameter> compoundParameters)
        {
            var allCompoundParameters      = compoundParameters.ToList();
            var compoundTypeAlternativeDTO = new CompoundTypeDTO();

            addTypePKaFor(compoundTypeAlternativeDTO, allCompoundParameters, CoreConstants.Parameter.ParameterPka1, CoreConstants.Parameter.COMPOUND_TYPE1);
            addTypePKaFor(compoundTypeAlternativeDTO, allCompoundParameters, CoreConstants.Parameter.ParameterPka2, CoreConstants.Parameter.COMPOUND_TYPE2);
            addTypePKaFor(compoundTypeAlternativeDTO, allCompoundParameters, CoreConstants.Parameter.ParameterPka3, CoreConstants.Parameter.COMPOUND_TYPE3);
            return(compoundTypeAlternativeDTO);
        }
예제 #6
0
        protected override void Context()
        {
            _entityPathResolver = A.Fake <IEntityPathResolver>();
            _view = A.Fake <ICompoundTypeGroupView>();
            _representationInfoRep = A.Fake <IRepresentationInfoRepository>();
            _mapper        = A.Fake <ICompoundToCompoundTypeDTOMapper>();
            _parameterTask = A.Fake <IParameterTask>();

            sut = new CompoundTypeGroupPresenter(_view, _representationInfoRep, _mapper, _parameterTask, _entityPathResolver);

            _parameters      = new List <IParameter>();
            _compoundTypeDTO = new CompoundTypeDTO();
            A.CallTo(() => _mapper.MapFrom(_parameters)).Returns(_compoundTypeDTO);
        }