Exemple #1
0
 protected override void Context()
 {
     base.Context();
     _selection = new PredefinedStatisticalAggregation {
         Method = _statisticalAggregationType
     };
 }
        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);
        }
Exemple #3
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);
 }
Exemple #4
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);
        }