Ejemplo n.º 1
0
        private void changeUnit(string pkParameterName, Unit newUnit)
        {
            _settings.SetSetting(pkParameterName, newUnit.Name);
            foreach (var pkAnalysis in AllPKAnalyses)
            {
                var pkParameter = pkAnalysis.Parameter(pkParameterName);

                //possible when mixing different application protocols
                if (pkParameter != null)
                {
                    pkParameter.DisplayUnit = newUnit;
                }
            }
        }
        protected override void Context()
        {
            base.Context();
            _settings = new DefaultPresentationSettings();
            A.CallTo(() => _presenterSettingsTask.PresentationSettingsFor <DefaultPresentationSettings>(A <IPresenterWithSettings> ._, A <IWithId> ._)).Returns(_settings);
            sut.LoadSettingsForSubject(A.Fake <IWithId>());
            _parameter = A.Fake <IParameter>();
            A.CallTo(() => _parameter.Dimension).Returns(new Dimension(new BaseDimensionRepresentation(), "dimensionfake", "baseUnitFake"));
            _parameter.Dimension.AddUnit("newname", 1000, 0);
            _globalPKAnalysis.Container(_compoundName).Add(_parameter);


            _preferredDisplayUnit = _parameter.Dimension.Units.Last();
            _settings.SetSetting(_parameter.Name, _preferredDisplayUnit);
        }
Ejemplo n.º 3
0
        protected override void Context()
        {
            base.Context();
            var dimension = new Dimension(new BaseDimensionRepresentation(), "none", "l/f");

            _newUnit = new Unit("kl/f", 1000, 0);
            dimension.AddUnit(_newUnit);

            _pkSimParameter = new PKSimParameter {
                Dimension = dimension
            };

            _allPKanalysis.First().PKAnalysis.Add(_pkSimParameter);
            _settings = new DefaultPresentationSettings();
            A.CallTo(() => _presenterSettingsTask.PresentationSettingsFor <DefaultPresentationSettings>(A <IPresenterWithSettings> ._, A <IWithId> ._)).Returns(_settings);
            _settings.SetSetting(_pkSimParameter.Name, "kl/f");
            A.CallTo(() => _populationDataCollector.Name).Returns("TOTO");
            sut.LoadSettingsForSubject(A.Fake <IWithId>());
        }
Ejemplo n.º 4
0
 public void ChangeUnit(string parameterName, Unit newUnit)
 {
     GlobalPKAnalysis.PKParameters(parameterName).Each(p => p.DisplayUnit = newUnit);
     _settings.SetSetting(parameterName, newUnit.Name);
     updateView();
 }