public void EditCompoundParameters(IEnumerable <IParameter> compoundParameters) { _molWeightParameters = compoundParameters.Where(x => string.Equals(x.GroupName, CoreConstants.Groups.COMPOUND_MW)).ToList(); _molWeightDTO = _molWeightDTOMapper.MapFrom(_molWeightParameters); _view.BindTo(new[] { _molWeightDTO.MolWeightParameter, _molWeightDTO.HasHalogensParameter, _molWeightDTO.MolWeightEffParameter }); _editValueOriginPresenter.Edit(_molWeightDTO.MolWeightParameter); }
protected override void Context() { base.Context(); _allParameters = new List <IParameter>(); _newMolWeightValue = 13; _molWeightParameter = new PKSimParameter(); _molWeightDTO = new MolWeightDTO(); _molWeightDTO.MolWeightParameter = new ParameterDTO(_molWeightParameter); _molWeightDTO.MolWeightEffParameter = new ParameterDTO(new PKSimParameter()); _command = A.Fake <IPKSimCommand>(); A.CallTo(() => _molWeightDTOMapper.MapFrom(_allParameters)).Returns(_molWeightDTO); A.CallTo(() => _parameterTask.SetParameterDisplayValue(_molWeightParameter, _newMolWeightValue)).Returns(_command); sut.EditCompoundParameters(_allParameters); }
protected override void Context() { _commandRegister = A.Fake <ICommandCollector>(); _view = A.Fake <IMolWeightGroupView>(); _parameterTask = A.Fake <IParameterTask>(); _molWeightsHalogenPresenters = A.Fake <IMolWeightHalogensPresenter>(); _molWeightDTOMapper = A.Fake <ICompoundToMolWeightDTOMapper>(); _representationInfoRepository = A.Fake <IRepresentationInfoRepository>(); _editValueOriginPresenter = A.Fake <IEditValueOriginPresenter>(); sut = new MolWeightGroupPresenter(_view, _representationInfoRepository, _molWeightDTOMapper, _molWeightsHalogenPresenters, _parameterTask, _editValueOriginPresenter); sut.InitializeWith(_commandRegister); _molWeightParameter = new PKSimParameter(); _molWeightParameterEff = new PKSimParameter(); _molWeightDTO = new MolWeightDTO { MolWeightParameter = new ParameterDTO(_molWeightParameter), MolWeightEffParameter = new ParameterDTO(_molWeightParameterEff) }; A.CallTo(_molWeightDTOMapper).WithReturnType <MolWeightDTO>().Returns(_molWeightDTO); }
public void SetMolWeightValue(MolWeightDTO molWeightDTO, double newMolWeightValue) { AddCommand(_parameterTask.SetParameterDisplayValue(molWeightDTO.MolWeightParameter.Parameter, newMolWeightValue)); }
public void EditCompoundParameters(IEnumerable <IParameter> compoundParameters) { _compoundParameters = compoundParameters.ToList(); _molWeightDTO = _molWeightDTOMapper.MapFrom(_compoundParameters); _view.BindTo(new[] { _molWeightDTO.MolWeightParameter, _molWeightDTO.HasHalogensParameter, _molWeightDTO.MolWeightEffParameter }); }