Beispiel #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);
 }
Beispiel #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);
        }