Exemplo n.º 1
0
 protected override void Context()
 {
     _objectBaseFactory = A.Fake <IObjectBaseFactory>();
     _cloner            = A.Fake <ICloner>();
     _speciesRepository = A.Fake <ISpeciesRepository>();
     //necessary to create compound since default parameter willl be added to the group based on compound parameters
     _compound = new Compound();
     _compoundParameterGroup = new ParameterAlternativeGroup();
     _compound.AddParameterAlternativeGroup(_compoundParameterGroup);
     _userSettings = A.Fake <ICoreUserSettings>();
     sut           = new ParameterAlternativeFactory(_objectBaseFactory, _cloner, _speciesRepository, _userSettings);
 }
 public SetDefaultAlternativeParameterCommand(PKSim.Core.Model.ParameterAlternativeGroup parameterGroup, PKSim.Core.Model.ParameterAlternative parameterAlternative, IExecutionContext context)
 {
     _parameterGroup = parameterGroup;
      _parameterGroupId = _parameterGroup.Id;
      _parameterAlternative = parameterAlternative;
      _oldDefaultAlternative = parameterGroup.DefaultAlternative;
      _oldDefaultAlternativeId = _oldDefaultAlternative.Id;
      ObjectType = PKSimConstants.ObjectTypes.Compound;
      CommandType = PKSimConstants.Command.CommandTypeEdit;
      BuildingBlockId = context.BuildingBlockIdContaining(parameterGroup);
      Description = PKSimConstants.Command.SetDefaultAlternativeParameterDescription(context.DisplayNameFor(parameterGroup), _oldDefaultAlternative.Name, parameterAlternative.Name);
      ShouldChangeVersion = false;
      context.UpdateBuildinBlockProperties(this, context.BuildingBlockContaining(parameterGroup));
 }
 protected override void ClearReferences()
 {
     _parameterGroup = null;
      _parameterAlternative = null;
      _oldDefaultAlternative = null;
 }
 public override void RestoreExecutionData(IExecutionContext context)
 {
     base.RestoreExecutionData(context);
      _parameterGroup = context.Get<PKSim.Core.Model.ParameterAlternativeGroup>(_parameterGroupId);
      _oldDefaultAlternative = context.Get<PKSim.Core.Model.ParameterAlternative>(_oldDefaultAlternativeId);
 }
 protected override void Context()
 {
     _compoundParameterGroup = A.Fake <PKSim.Core.Model.ParameterAlternativeGroup>();
     A.CallTo(() => _compoundParameterGroup.Name).Returns("tralala");
     sut = new CompoundParameterSelectionDTO(_compoundParameterGroup);
 }
Exemplo n.º 6
0
 public virtual void AddParameterAlternativeGroup(ParameterAlternativeGroup parameterAlternativeGroup)
 {
     Add(parameterAlternativeGroup);
 }
 private bool groupHasAlternativeWithSpecies(ParameterAlternativeGroup group) => CoreConstants.Groups.GroupsWithAlternativeAndSpecies.Contains(group.Name);
 private bool groupHasCalculatedAlternative(ParameterAlternativeGroup group) => CoreConstants.Groups.GroupsWithCalculatedAlternative.Contains(group.Name);