コード例 #1
0
        protected override void Context()
        {
            _entityPathResolver           = new EntityPathResolverForSpecs();
            _representationInfoRepository = new RepresentationInfoRepositoryForSpecs();
            sut = new PKSimPathToPathElementsMapper(_representationInfoRepository, _entityPathResolver);

            _organism                = new Organism();
            _venousBlood             = new Organ().WithName(CoreConstants.Organ.VenousBlood).WithParentContainer(_organism);
            _liver                   = new Organ().WithName(CoreConstants.Organ.Liver).WithParentContainer(_organism);
            _kidney                  = new Organ().WithName(CoreConstants.Organ.Kidney).WithParentContainer(_organism);
            _liverInt                = new Compartment().WithName(CoreConstants.Compartment.Interstitial).WithParentContainer(_liver);
            _liverCell               = new Compartment().WithName(CoreConstants.Compartment.Intracellular).WithParentContainer(_liver);
            _kidneyUrine             = new Compartment().WithName(CoreConstants.Compartment.URINE).WithParentContainer(_kidney);
            _gallBladder             = new Organ().WithName(CoreConstants.Organ.Gallbladder).WithParentContainer(_organism);
            _lumen                   = new Organ().WithName(CoreConstants.Organ.Lumen).WithParentContainer(_organism);
            _peripheralVenousBlood   = new Container().WithName(CoreConstants.Organ.PeripheralVenousBlood).WithParentContainer(_organism);
            _smallIntestine          = new Organ().WithName(CoreConstants.Organ.SmallIntestine).WithParentContainer(_organism);
            _mucosa                  = new Compartment().WithName(CoreConstants.Compartment.Mucosa).WithParentContainer(_smallIntestine);
            _mucosa_duo              = new Compartment().WithName(CoreConstants.Compartment.Duodenum).WithParentContainer(_mucosa);
            _mucosa_duo_interstitial = new Compartment().WithName(CoreConstants.Compartment.Interstitial).WithParentContainer(_mucosa_duo);

            _events     = new Container().WithName(Constants.EVENTS);
            _eventGroup = new EventGroup().WithName("E1").WithParentContainer(_events);
            _plasma     = new Compartment().WithName(CoreConstants.Compartment.Plasma).WithParentContainer(_venousBlood);
            _drugContainerVenousBlood           = new Container().WithName(_drugName).WithContainerType(ContainerType.Molecule).WithParentContainer(_venousBlood);
            _drugContainerPeripheralVenousBlood = new Container().WithName(_drugName).WithContainerType(ContainerType.Molecule).WithParentContainer(_peripheralVenousBlood);
            _drugContainerGallBladder           = new Container().WithName(_drugName).WithContainerType(ContainerType.Molecule).WithParentContainer(_gallBladder);
            _drugContainerInLumen     = new Container().WithName(_drugName).WithContainerType(ContainerType.Molecule).WithParentContainer(_lumen);
            _drugContainerInLiverCell = new Container().WithName(_drugName).WithContainerType(ContainerType.Molecule).WithParentContainer(_liverCell);
            _drug = new MoleculeAmount().WithName(_drugName).WithParentContainer(_plasma);

            _drugUrineKidney = new MoleculeAmount().WithName(_drugName).WithParentContainer(_kidneyUrine);
            _applications    = new Container().WithName(Constants.APPLICATIONS);
            _application1    = new EventGroup().WithName("App").WithParentContainer(_applications).WithContainerType(ContainerType.EventGroup);
            _formulation     = new Container().WithName("F1").WithParentContainer(_application1);

            _neighborhoods = new Container().WithName(Constants.NEIGHBORHOODS);
            _liverCellToLiverIntNeighborhood = new Neighborhood {
                FirstNeighbor = _liverInt, SecondNeighbor = _liverCell
            }.WithParentContainer(_neighborhoods);
            _concentrationDimension = DomainHelperForSpecs.ConcentrationDimensionForSpecs();
            _fractionDimension      = DomainHelperForSpecs.FractionDimensionForSpecs();
        }
コード例 #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);
        }