Ejemplo n.º 1
0
 protected override void Context()
 {
     _dimensionRepository          = A.Fake <IDimensionRepository>();
     _representationInfoRepository = A.Fake <IRepresentationInfoRepository>();
     _lazyLoadTask            = A.Fake <ILazyLoadTask>();
     _observedcurveDataMapper = A.Fake <IDataRepositoryToObservedCurveDataMapper>();
     _statisticalAnalysis     = new PopulationStatisticalAnalysis();
     _genderField             = ChartDataHelperForSpecs.CreateGenderField();
     _statisticalAnalysis.Add(_genderField);
     _statisticalAnalysis.Add(_outputFieldVenousBloodPlasma);
     _statisticalAnalysis.Add(_outputFieldLiverCell);
     _predefinedStatisticalAggregation = new PredefinedStatisticalAggregation {
         Selected = true
     };
     _percentileStatisticalAggregation = new PercentileStatisticalAggregation {
         Selected = false, Percentile = 50
     };
     _statisticalAnalysis.AddStatistic(_predefinedStatisticalAggregation);
     _statisticalAnalysis.AddStatistic(_percentileStatisticalAggregation);
     A.CallTo(() => _representationInfoRepository.DisplayNameFor(_predefinedStatisticalAggregation)).Returns(_singlecurveId);
     A.CallTo(() => _representationInfoRepository.DisplayNameFor(_percentileStatisticalAggregation)).Returns(_percentileId);
     _statisticalDataCalculator = new StatisticalDataCalculator();
     _pivotResultCreator        = A.Fake <IPivotResultCreator>();
     sut = new TimeProfileChartDataCreator(_dimensionRepository, _pivotResultCreator, _representationInfoRepository,
                                           _statisticalDataCalculator, _lazyLoadTask, _observedcurveDataMapper);
 }
Ejemplo n.º 2
0
        protected override void Context()
        {
            _dimensionRepository          = A.Fake <IDimensionRepository>();
            _representationInfoRepository = A.Fake <IRepresentationInfoRepository>();
            _lazyLoadTask            = A.Fake <ILazyLoadTask>();
            _observedCurveDataMapper = A.Fake <IDataRepositoryToObservedCurveDataMapper>();
            _statisticalAnalysis     = new PopulationStatisticalAnalysis();
            _genderField             = ChartDataHelperForSpecs.CreateGenderField();
            _statisticalAnalysis.Add(_genderField);
            _statisticalAnalysis.Add(_outputFieldVenousBloodPlasma);
            _statisticalAnalysis.Add(_outputFieldLiverCell);
            _predefinedStatisticalAggregation = new PredefinedStatisticalAggregation {
                Selected = true
            };
            _percentileStatisticalAggregation = new PercentileStatisticalAggregation {
                Selected = false, Percentile = 50
            };
            _statisticalAnalysis.AddStatistic(_predefinedStatisticalAggregation);
            _statisticalAnalysis.AddStatistic(_percentileStatisticalAggregation);
            A.CallTo(() => _representationInfoRepository.DisplayNameFor(_predefinedStatisticalAggregation)).Returns(_singleCurveId);
            A.CallTo(() => _representationInfoRepository.DisplayNameFor(_percentileStatisticalAggregation)).Returns(_percentileId);
            _statisticalDataCalculator = new StatisticalDataCalculator();
            _pivotResultCreator        = A.Fake <IPivotResultCreator>();

            _mergedDimensionVenousBloodPlasma = DomainHelperForSpecs.ConcentrationDimensionForSpecs();
            _mergedDimensionLiverCell         = DomainHelperForSpecs.FractionDimensionForSpecs();

            A.CallTo(() => _dimensionRepository.MergedDimensionFor(A <IWithDimension> ._))
            .WhenArgumentsMatch((IWithDimension context) => Equals((context as NumericFieldContext)?.NumericValueField, _outputFieldVenousBloodPlasma))
            .Returns(_mergedDimensionVenousBloodPlasma);

            A.CallTo(() => _dimensionRepository.MergedDimensionFor(A <IWithDimension> ._))
            .WhenArgumentsMatch((IWithDimension context) => Equals((context as NumericFieldContext)?.NumericValueField, _outputFieldLiverCell))
            .Returns(_mergedDimensionLiverCell);

            sut = new TimeProfileChartDataCreator(_dimensionRepository, _pivotResultCreator, _representationInfoRepository,
                                                  _statisticalDataCalculator, _lazyLoadTask, _observedCurveDataMapper);
        }
        protected override void Context()
        {
            _view = A.Fake <IEditTimeProfileAnalysisChartView>();
            _timeProfilerChartPresenter          = A.Fake <ITimeProfileChartPresenter>();
            _timeProfileChartDataCreator         = A.Fake <ITimeProfileChartDataCreator>();
            _populationSimulationAnalysisStarter = A.Fake <IPopulationSimulationAnalysisStarter>();
            _populationAnalysisTask = A.Fake <IPopulationAnalysisTask>();
            _colorGenerator         = A.Fake <IColorGenerator>();
            _observedDataTask       = A.Fake <IObservedDataTask>();
            _pkAnalysisPresenter    = A.Fake <IPopulationPKAnalysisPresenter>();
            _dimensionRepository    = A.Fake <IDimensionRepository>();

            _presenterSettingsTask = A.Fake <IPresentationSettingsTask>();
            sut = new EditTimeProfileAnalysisChartPresenter(_view, _timeProfilerChartPresenter, _timeProfileChartDataCreator,
                                                            _populationSimulationAnalysisStarter, _populationAnalysisTask, _colorGenerator, _observedDataTask, _pkAnalysisPresenter, _dimensionRepository, _presenterSettingsTask);

            _timeProfileAnalysisChart      = new TimeProfileAnalysisChart();
            _populationStatisticalAnalysis = new PopulationStatisticalAnalysis();
            _timeProfileAnalysisChart.PopulationAnalysis = _populationStatisticalAnalysis;
            _populationDataCollector = A.Fake <IPopulationDataCollector>();
            sut.InitializeAnalysis(_timeProfileAnalysisChart, _populationDataCollector);

            _observedDataRepository = DomainHelperForSpecs.ObservedData();
            var data = new DragDropInfo(
                new List <ITreeNode> {
                new ObservedDataNode(new ClassifiableObservedData {
                    Subject = _observedDataRepository
                })
            }
                );

            _dragEventArgs = new DragEventArgs(new DataObject(data), 0, 0, 0, DragDropEffects.All, DragDropEffects.All);

            _chartData = new ChartData <TimeProfileXValue, TimeProfileYValue>(null, null);
            var concentrationDimension = DomainHelperForSpecs.ConcentrationDimensionForSpecs();
            var yAxis = new AxisData(concentrationDimension, concentrationDimension.DefaultUnit, Scalings.Linear);

            _paneData = new PaneData <TimeProfileXValue, TimeProfileYValue>(yAxis);
            _chartData.AddPane(_paneData);
            A.CallTo(_timeProfileChartDataCreator).WithReturnType <ChartData <TimeProfileXValue, TimeProfileYValue> >().Returns(_chartData);

            var outputField = new PopulationAnalysisOutputField {
                Dimension = DomainHelperForSpecs.MassConcentrationDimensionForSpecs()
            };

            _populationStatisticalAnalysis.Add(outputField);

            A.CallTo(() => _dimensionRepository.MergedDimensionFor(A <NumericFieldContext> ._)).Returns(concentrationDimension);
        }
Ejemplo n.º 4
0
        protected override void Context()
        {
            base.Context();
            _populationSimulation = new PopulationSimulation {
                SimulationSettings = new SimulationSettings {
                    OutputSelections = new OutputSelections()
                }
            };

            var liverCellsDrugConc = "Liver|Cells|Drug|Conc";

            _populationSimulation.OutputSelections.AddOutput(new QuantitySelection(liverCellsDrugConc, QuantityType.Drug));
            _populationSimulation.OutputSelections.AddOutput(new QuantitySelection("Liver|Plasma|Drug|Conc", QuantityType.Drug));

            _populationStatisticalAnalysis = new PopulationStatisticalAnalysis();
            _timeProfileAnalysis           = new TimeProfileAnalysisChart {
                PopulationAnalysis = _populationStatisticalAnalysis
            };

            _outputField1 = new PopulationAnalysisOutputField {
                QuantityPath = "Kidney|Cell|Drug|Conc", Name = "outputField1"
            };
            _derivedField1 = new PopulationAnalysisGroupingField(new NumberOfBinsGroupingDefinition(_outputField1.Name))
            {
                Name = "derivedField1"
            };

            _outputField2 = new PopulationAnalysisOutputField {
                QuantityPath = liverCellsDrugConc, Name = "outputField2"
            };
            _derivedField2 = new PopulationAnalysisGroupingField(new NumberOfBinsGroupingDefinition(_outputField2.Name))
            {
                Name = "derivedField2"
            };

            _pkField1 = new PopulationAnalysisPKParameterField {
                QuantityPath = "Kidney|Cell|Drug|Conc", Name = "pkField1"
            };
            _pkDerivedField1 = new PopulationAnalysisGroupingField(new NumberOfBinsGroupingDefinition(_pkField1.Name))
            {
                Name = "pkDerivedField1"
            };

            _pkField2 = new PopulationAnalysisPKParameterField {
                QuantityPath = liverCellsDrugConc, Name = "pkField2"
            };
            _pkDerivedField2 = new PopulationAnalysisGroupingField(new NumberOfBinsGroupingDefinition(_pkField2.Name))
            {
                Name = "pkDerivedField2"
            };

            _populationStatisticalAnalysis.Add(_outputField1);
            _populationStatisticalAnalysis.Add(_outputField2);
            _populationStatisticalAnalysis.Add(_derivedField1);
            _populationStatisticalAnalysis.Add(_derivedField2);
            _populationStatisticalAnalysis.Add(_pkField1);
            _populationStatisticalAnalysis.Add(_pkField2);
            _populationStatisticalAnalysis.Add(_pkDerivedField1);
            _populationStatisticalAnalysis.Add(_pkDerivedField2);
            _populationSimulation.AddAnalysis(_timeProfileAnalysis);
        }