protected override void Context()
 {
     _renamedField = new PopulationAnalysisParameterField {
         Name = _oldName, ParameterPath = "Path"
     };
     _groupingFieldUsing1 = new PopulationAnalysisGroupingField(new NumberOfBinsGroupingDefinition(_oldName)
     {
         NumberOfBins = 5
     })
     {
         Name = "Using1"
     };
     _groupingFieldUsing2 = new PopulationAnalysisGroupingField(new FixedLimitsGroupingDefinition(_oldName))
     {
         Name = "Using2"
     };
     _groupingFieldNotUsing = new PopulationAnalysisGroupingField(new FixedLimitsGroupingDefinition("ANOTHER NAME"))
     {
         Name = "NotUsing"
     };
     _expressionField = new PopulationAnalysisExpressionField($"[{_oldName}] + [Field2]")
     {
         Name = "Expression"
     };
     sut = new PopulationPivotAnalysis();
     sut.Add(_renamedField);
     sut.Add(_groupingFieldUsing1);
     sut.Add(_groupingFieldNotUsing);
     sut.Add(_groupingFieldUsing2);
     sut.Add(_expressionField);
 }
Example #2
0
        protected override void Context()
        {
            _pivotAnalysis = new PopulationPivotAnalysis();
            _pivotAnalysis.Add(_genderField);
            _pivotAnalysis.Add(_raceField);
            _pivotAnalysis.Add(_bmiField);
            _pivotAnalysis.Add(_cmaxField);
            var grouping = new FixedLimitsGroupingDefinition(_bmiField.Name);

            grouping.SetLimits(new[] { 25d }.OrderBy(x => x));
            grouping.AddItems(PopulationAnalysisHelperForSpecs.BMIGroups);
            _bmiClass = new PopulationAnalysisGroupingField(grouping)
            {
                Name = "BMI class"
            };
            _pivotAnalysis.Add(_bmiClass);
            _dimensionRepository = A.Fake <IDimensionRepository>();
            _pivotResultCreator  = A.Fake <IPivotResultCreator>();
            var userSettings = A.Fake <ICoreUserSettings>();

            userSettings.NumberOfIndividualsPerBin = 1;
            userSettings.NumberOfBins = 2;
            _binIntervalsCreator      = new BinIntervalsCreator(userSettings);
            sut = new RangeChartDataCreator(_dimensionRepository, _pivotResultCreator, _binIntervalsCreator);
        }
Example #3
0
        protected override void Context()
        {
            base.Context();
            _populationDataCollector    = A.Fake <IPopulationDataCollector>();
            _templatePopulationAnalysis = new PopulationPivotAnalysis();

            _parameterFound = new PopulationAnalysisParameterField {
                ParameterPath = "P1"
            };
            _parameterNotFound = new PopulationAnalysisParameterField {
                ParameterPath = "P2"
            };

            _templatePopulationAnalysis.Add(_parameterFound);
            _templatePopulationAnalysis.Add(_parameterNotFound);

            _cache = new PathCacheForSpecs <IParameter> {
                { "P1", new PKSimParameter() }
            };

            A.CallTo(_templateTask).WithReturnType <PopulationAnalysis>().Returns(_templatePopulationAnalysis);

            A.CallTo(() => _entitiesInContainerRetriever.ParametersFrom(_populationDataCollector)).Returns(_cache);
            A.CallTo(_dialogCreator).WithReturnType <ViewResult>().Returns(ViewResult.Yes);
        }
        protected override Task Context()
        {
            _fieldMapper = A.Fake <PopulationAnalysisFieldMapper>();
            sut          = new PopulationAnalysisMapper(_fieldMapper);

            _populationStatisticalAnalysis = new PopulationStatisticalAnalysis();
            _selectedStatisticalAnalysis   = new PredefinedStatisticalAggregation {
                Method = StatisticalAggregationType.Max, Selected = true, LineStyle = LineStyles.Dash
            };
            _populationStatisticalAnalysis.AddStatistic(_selectedStatisticalAnalysis);
            _populationStatisticalAnalysis.AddStatistic(new PredefinedStatisticalAggregation {
                Method = StatisticalAggregationType.Min, Selected = false
            });

            _populationBoxWiskerAnalysis = new PopulationBoxWhiskerAnalysis {
                ShowOutliers = true
            };

            _field1 = A.Fake <IPopulationAnalysisField>().WithName("Field1");
            _field2 = A.Fake <IPopulationAnalysisField>().WithName("Field2");
            _populationPivotAnalysis = new PopulationPivotAnalysis();
            _populationPivotAnalysis.Add(_field1);
            _populationPivotAnalysis.Add(_field2);
            _populationPivotAnalysis.SetPosition(_field1, PivotArea.FilterArea, 1);
            _populationPivotAnalysis.SetPosition(_field2, PivotArea.RowArea, 2);
            _snapshotField1 = new PopulationAnalysisField().WithName(_field1.Name);
            _snapshotField2 = new PopulationAnalysisField().WithName(_field2.Name);

            A.CallTo(() => _fieldMapper.MapToSnapshot(_field1)).Returns(_snapshotField1);
            A.CallTo(() => _fieldMapper.MapToSnapshot(_field2)).Returns(_snapshotField2);
            return(_completed);
        }
 protected override void Context()
 {
     base.Context();
     _pivotAnalysis  = new PopulationPivotAnalysis();
     _parameterField = new PopulationAnalysisCovariateField().WithName("Param");
     _dataArea       = new PopulationAnalysisParameterField().WithName("OnFilter");
     _pivotAnalysis.Add(_parameterField);
     _pivotAnalysis.Add(_dataArea);
     _pivotAnalysis.SetPosition(_dataArea, PivotArea.DataArea, 0);
 }
 protected override void Context()
 {
     base.Context();
     _pivotAnalysis      = new PopulationPivotAnalysis();
     _parameterField     = new PopulationAnalysisCovariateField().WithName("Param");
     _existingColorField = new PopulationAnalysisCovariateField().WithName("ColorField");
     _filterArea         = new PopulationAnalysisParameterField().WithName("OnFilter");
     _pivotAnalysis.Add(_parameterField);
     _pivotAnalysis.Add(_existingColorField);
     _pivotAnalysis.Add(_filterArea);
     _pivotAnalysis.SetPosition(_filterArea, PivotArea.FilterArea, 0);
     _pivotAnalysis.ColorField = _existingColorField;
 }
        protected override void Context()
        {
            base.Context();
            _sourcePivotAnalysis           = new PopulationPivotAnalysis();
            _pkParameterField              = new PopulationAnalysisPKParameterField().WithName("PKParam");
            _pkParameterField.PKParameter  = "AUC";
            _pkParameterField.QuantityPath = "A|B|C";

            _parameterField = new PopulationAnalysisParameterField().WithName("Param");
            _parameterField.ParameterPath = "A|B|C|D";
            _sourcePivotAnalysis.Add(_pkParameterField);
            _sourcePivotAnalysis.Add(_parameterField);
            _sourcePivotAnalysis.SetPosition(_parameterField, PivotArea.DataArea, 1);
            _sourcePivotAnalysis.SetPosition(_pkParameterField, PivotArea.RowArea, 2);
        }
 protected override void Context()
 {
     base.Context();
     _pivotAnalysis = new PopulationPivotAnalysis();
     _field         = new PopulationAnalysisCovariateField().WithName("Param");
     _pivotAnalysis.Add(_field);
 }
        protected override async Task Context()
        {
            await base.Context();

            _populationDataCollector    = A.Fake <IPopulationDataCollector>();
            _templatePopulationAnalysis = new PopulationPivotAnalysis();

            _pkParameterFound = new PopulationAnalysisPKParameterField {
                QuantityType = QuantityType.Drug, PKParameter = "AUC", QuantityPath = "P1"
            };
            _quantityNotFound = new PopulationAnalysisPKParameterField {
                QuantityType = QuantityType.Drug, PKParameter = "AUC", QuantityPath = "P2"
            };
            _pkParameterNotFound = new PopulationAnalysisPKParameterField {
                QuantityType = QuantityType.Metabolite, PKParameter = "AUC", QuantityPath = "P3"
            };

            _templatePopulationAnalysis.Add(_pkParameterFound);
            _templatePopulationAnalysis.Add(_quantityNotFound);
            _templatePopulationAnalysis.Add(_pkParameterNotFound);

            _cache = new PathCacheForSpecs <IQuantity>
            {
                { "P1", new MoleculeAmount {
                      QuantityType = QuantityType.Drug
                  } },
                { "Q2", new MoleculeAmount {
                      QuantityType = QuantityType.Drug
                  } },
                { "P3", new MoleculeAmount {
                      QuantityType = QuantityType.Metabolite
                  } }
            };

            A.CallTo(() => _populationDataCollector.HasPKParameterFor("P1", "AUC")).Returns(true);
            A.CallTo(() => _populationDataCollector.HasPKParameterFor("P2", "AUC")).Returns(false);
            A.CallTo(() => _populationDataCollector.HasPKParameterFor("P3", "AUC")).Returns(false);

            A.CallTo(_templateTask).WithReturnType <Task <PopulationAnalysis> >().Returns(_templatePopulationAnalysis);

            A.CallTo(() => _entitiesInContainerRetriever.OutputsFrom(_populationDataCollector)).Returns(_cache);
            A.CallTo(_dialogCreator).WithReturnType <ViewResult>().Returns(ViewResult.Yes);

            A.CallTo(() => _keyPathMapper.MapFrom(_pkParameterFound.QuantityPath, QuantityType.Drug, true)).Returns(new KeyPathMap("P1"));
            A.CallTo(() => _keyPathMapper.MapFrom(_quantityNotFound.QuantityPath, QuantityType.Drug, true)).Returns(new KeyPathMap("QUANTITY NOT FOUND"));
            A.CallTo(() => _keyPathMapper.MapFrom(_pkParameterNotFound.QuantityPath, QuantityType.Metabolite, true)).Returns(new KeyPathMap("P3"));
        }
Example #10
0
        protected override void Context()
        {
            _pivotAnalysis = new PopulationPivotAnalysis();
            _pivotAnalysis.Add(_genderField);
            _pivotAnalysis.Add(_raceField);
            _pivotAnalysis.Add(_bmiField);
            _pivotAnalysis.Add(_cmaxField);
            var grouping = new FixedLimitsGroupingDefinition(_bmiField.Name);

            grouping.SetLimits(new[] { 25d }.OrderBy(x => x));
            grouping.AddItems(PopulationAnalysisHelperForSpecs.BMIGroups);
            _bmiClass = new PopulationAnalysisGroupingField(grouping)
            {
                Name = "BMI class"
            };
            _pivotAnalysis.Add(_bmiClass);
            _dimensionRepository = A.Fake <IDimensionRepository>();
            _pivotResultCreator  = A.Fake <IPivotResultCreator>();
            sut = new ScatterChartDataCreator(_dimensionRepository, _pivotResultCreator);
        }
Example #11
0
        protected override void Context()
        {
            base.Context();
            _populationDataCollector    = A.Fake <IPopulationDataCollector>();
            _templatePopulationAnalysis = new PopulationPivotAnalysis();

            _covariateFound = new PopulationAnalysisCovariateField {
                Covariate = "Covariate1"
            };
            _covariateNotFound = new PopulationAnalysisCovariateField {
                Covariate = "Covariate2"
            };

            _templatePopulationAnalysis.Add(_covariateFound);
            _templatePopulationAnalysis.Add(_covariateNotFound);

            A.CallTo(_templateTask).WithReturnType <PopulationAnalysis>().Returns(_templatePopulationAnalysis);

            A.CallTo(() => _populationDataCollector.AllCovariateNames).Returns(new List <string> {
                _covariateFound.Covariate
            });
            A.CallTo(_dialogCreator).WithReturnType <ViewResult>().Returns(ViewResult.Yes);
        }