protected override void Context() { base.Context(); _compound = new Compound(); var solDim = new Dimension(new BaseDimensionRepresentation(), "Solubility", "m"); solDim.AddUnit(new Unit("cm", 0.01, 0)); _solubilityTableFormula = new TableFormula(); var solubilityTable = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.SOLUBILITY_TABLE).WithDimension(solDim); solubilityTable.Formula = _solubilityTableFormula; _solubilityAlternative = new ParameterAlternative { solubilityTable }; var solubilityAlternativeGroup = new ParameterAlternativeGroup(); solubilityAlternativeGroup.AddAlternative(_solubilityAlternative); _compound.AddParameterAlternativeGroup(solubilityAlternativeGroup); }
protected override void Context() { base.Context(); var solDim = new Dimension(new BaseDimensionRepresentation(), "Solubility", "m"); solDim.AddUnit(new Unit("cm", 0.01, 0)); _refPhValue = 7; _solValue = 100; _gainPerChargeValue = 1000; A.CallTo(_formulaFactory).WithReturnType <TableFormula>().Returns(new TableFormula()); var solubilityTable = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.SOLUBILITY_TABLE).WithDimension(solDim); var refPh = DomainHelperForSpecs.ConstantParameterWithValue(_refPhValue).WithName(CoreConstants.Parameters.REFERENCE_PH).WithDimension(DomainHelperForSpecs.NoDimension()); var solubilty = DomainHelperForSpecs.ConstantParameterWithValue(_solValue).WithName(CoreConstants.Parameters.SOLUBILITY_AT_REFERENCE_PH).WithDimension(solDim); var gainPerCharge = DomainHelperForSpecs.ConstantParameterWithValue(_gainPerChargeValue).WithName(CoreConstants.Parameters.SOLUBILITY_GAIN_PER_CHARGE).WithDimension(DomainHelperForSpecs.NoDimension()); _solubility_pKa_pH_Factor = new PKSimParameter().WithName(CoreConstants.Parameters.SOLUBILITY_P_KA__P_H_FACTOR); _solubility_pKa_pH_Factor.Formula = new ExplicitFormula("10 * (pH +1)"); _solubility_pKa_pH_Factor.Formula.AddObjectPath(new FormulaUsablePath(new[] { ObjectPath.PARENT_CONTAINER, CoreConstants.Parameters.REFERENCE_PH }).WithAlias("pH")); _compoundForCalculation = new Compound { refPh, solubilty, gainPerCharge, _solubility_pKa_pH_Factor }; _solubilityAlternative = new ParameterAlternative { refPh, solubilty, gainPerCharge, solubilityTable }; var solubilityAlternativeGroup = new ParameterAlternativeGroup(); solubilityAlternativeGroup.AddAlternative(_solubilityAlternative); _originalRefPh = DomainHelperForSpecs.ConstantParameterWithValue(_refPhValue).WithName(CoreConstants.Parameters.REFERENCE_PH).WithDimension(DomainHelperForSpecs.NoDimension()); _originalRefPh.Value = 4; _compound = new Compound { _originalRefPh }; _compound.AddParameterAlternativeGroup(solubilityAlternativeGroup); A.CallTo(() => _executionContext.Clone(_compound)).Returns(_compoundForCalculation); }