protected override void Context()
 {
     base.Context();
     sut.AxisBy(AxisTypes.Y).Dimension  = DomainHelperForSpecs.ConcentrationDimensionForSpecs();
     sut.AxisBy(AxisTypes.Y2).Dimension = DomainHelperForSpecs.FractionDimensionForSpecs();
     sut.AxisBy(AxisTypes.Y3).Dimension = DomainHelperForSpecs.LengthDimensionForSpecs();
     sut.AxisBy(AxisTypes.X).Dimension  = sut.AxisBy(AxisTypes.Y3).Dimension;
 }
 protected override void Context()
 {
     base.Context();
     _mergedDimension = DomainHelperForSpecs.ConcentrationDimensionForSpecs();
     _field           = A.Fake <PopulationAnalysisNumericField>();
     _field.Dimension = DomainHelperForSpecs.FractionDimensionForSpecs();
     A.CallTo((_dimensionRepository)).WithReturnType <IDimension>().Returns(_mergedDimension);
 }
Exemplo n.º 3
0
 protected override void Because()
 {
     sut.SetOptions(new Column
     {
         Unit = new UnitDescription("min"), Dimension = DomainHelperForSpecs.TimeDimensionForSpecs()
     }, new List <IDimension>()
     {
         DomainHelperForSpecs.ConcentrationDimensionForSpecs(), DomainHelperForSpecs.FractionDimensionForSpecs(),
     }, A.Fake <IEnumerable <string> >());
 }
Exemplo n.º 4
0
        protected override void Context()
        {
            base.Context();
            _parameterIdentification = new ParameterIdentification();
            var outputMapping = A.Fake <OutputMapping>();

            ConfigureOutputMapping(outputMapping);

            _parameterIdentification.AddOutputMapping(outputMapping);
            _parameterIdentification.AddIdentificationParameter(DomainHelperForSpecs.IdentificationParameter());
            _parameterIdentification.Configuration.AlgorithmProperties = new OptimizationAlgorithmProperties("XX");
            outputMapping.Output.Dimension = DomainHelperForSpecs.FractionDimensionForSpecs();
        }
        protected override void Context()
        {
            _view = A.Fake <IShowOntogenyDataView>();
            _ontogenyRepository   = A.Fake <IOntogenyRepository>();
            _simpleChartPresenter = A.Fake <ISimpleChartPresenter>();
            _dimensionRepository  = A.Fake <IDimensionRepository>();
            _groupRepository      = A.Fake <IGroupRepository>();
            _displayUnitRetriever = A.Fake <IDisplayUnitRetriever>();

            _groupLiver = new Group {
                Name = "Liver"
            };
            _groupDuodenum = new Group {
                Name = "Duodenum"
            };
            _tableFormula = new TableFormula();
            _ontogeny     = new DatabaseOntogeny {
                SpeciesName = "toto"
            };
            _anotherOntogeny = new DatabaseOntogeny {
                SpeciesName = "toto"
            };
            _allOntongies = new List <Ontogeny> {
                _ontogeny, _anotherOntogeny
            };
            _ontoData = new List <OntogenyMetaData>();
            _ontoData.Add(new OntogenyMetaData {
                GroupName = "Liver"
            });
            _ontoData.Add(new OntogenyMetaData {
                GroupName = "Duodenum"
            });
            _allMetaData = new List <OntogenyMetaData>();

            A.CallTo(() => _dimensionRepository.AgeInYears).Returns(A.Fake <IDimension>());
            A.CallTo(() => _dimensionRepository.Fraction).Returns(DomainHelperForSpecs.FractionDimensionForSpecs());
            A.CallTo(() => _simpleChartPresenter.Plot(A <TableFormula> ._)).Returns(new CurveChart().WithAxes());
            A.CallTo(() => _simpleChartPresenter.Plot(A <DataRepository> ._, Scalings.Linear)).Returns(new CurveChart().WithAxes());
            A.CallTo(() => _groupRepository.GroupByName("Liver")).Returns(_groupLiver);
            A.CallTo(() => _groupRepository.GroupByName("Duodenum")).Returns(_groupDuodenum);
            A.CallTo(() => _ontogenyRepository.AllValuesFor(_ontogeny)).Returns(_ontoData);
            A.CallTo(() => _ontogenyRepository.AllFor(_ontogeny.SpeciesName)).Returns(_allOntongies);
            A.CallTo(() => _ontogenyRepository.AllValuesFor(_ontogeny, _groupLiver.Name)).Returns(_allMetaData);

            sut = new ShowOntogenyDataPresenter(_view, _ontogenyRepository, _simpleChartPresenter, _dimensionRepository, _groupRepository, _displayUnitRetriever);

            A.CallTo(() => _view.BindTo(A <ShowOntogenyDataDTO> ._))
            .Invokes(x => ShowOntogenyDataDTO = x.GetArgument <ShowOntogenyDataDTO>(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();
        }
        protected override void Context()
        {
            _containerTask = A.Fake <IContainerTask>();
            _identificationParameterTask = A.Fake <IIdentificationParameterTask>();
            _objectBaseFactory           = A.Fake <IObjectBaseFactory>();
            sut = new IdentificationParameterFactory(_objectBaseFactory, _containerTask, _identificationParameterTask);

            _simulationParameterSelection = new List <ParameterSelection>();
            _parameterIdentification      = new ParameterIdentification();

            _simulation            = A.Fake <ISimulation>();
            _simulation.Model.Root = new Container();

            A.CallTo(() => _objectBaseFactory.Create <IdentificationParameter>()).Returns(new IdentificationParameter());
            _parameterIdentification.AddSimulation(_simulation);

            _lengthLiver   = A.Fake <IParameter>().WithName("Length").WithDimension(DomainHelperForSpecs.LengthDimensionForSpecs());
            _fractionLiver = A.Fake <IParameter>().WithName("Fraction").WithDimension(DomainHelperForSpecs.FractionDimensionForSpecs());
            _lengthKidney  = A.Fake <IParameter>().WithName("Length").WithDimension(DomainHelperForSpecs.LengthDimensionForSpecs());
            var logDimension = A.Fake <IDimension>();

            A.CallTo(() => logDimension.Name).Returns(Constants.Dimension.LOG_UNITS);
            _lipoKidney = A.Fake <IParameter>().WithName("Lipo").WithDimension(logDimension);
            _fracKidney = A.Fake <IParameter>().WithName("Frac").WithDimension(DomainHelperForSpecs.FractionDimensionForSpecs());

            var liver  = new Container().WithName("Liver");
            var kidney = new Container().WithName("Kidney");

            liver.Add(_lengthLiver);
            liver.Add(_fractionLiver);
            kidney.Add(_lengthKidney);
            kidney.Add(_lipoKidney);
            kidney.Add(_fracKidney);
            _simulation.Model.Root.Add(liver);
            _simulation.Model.Root.Add(kidney);


            _simulationParameterSelection.Add(new ParameterSelection(_simulation, new QuantitySelection("Liver|Length", QuantityType.Parameter)));
        }
Exemplo n.º 8
0
 protected override void InitializeChart()
 {
     base.InitializeChart();
     _chart.AxisBy(AxisTypes.X).Dimension = _xDataColumn.Dimension;
     _chart.AxisBy(AxisTypes.Y).Dimension = DomainHelperForSpecs.FractionDimensionForSpecs();
 }
 protected override void Context()
 {
     base.Context();
     _dataRepository = DomainHelperForSpecs.ObservedData();
     _dataRepository.FirstDataColumn().Dimension = DomainHelperForSpecs.FractionDimensionForSpecs();
 }
Exemplo n.º 10
0
 protected override void Context()
 {
     _normParameter = new ParameterDTO(DomainHelperForSpecs.ConstantParameterWithValue(0.10).WithDimension(DomainHelperForSpecs.FractionDimensionForSpecs()));
     sut            = new ExpressionContainerDTO {
         RelativeExpressionNormParameter = _normParameter
     };
 }
Exemplo n.º 11
0
 public void should_return_lin_for_a_fraction_quantity()
 {
     _quantity.Dimension = DomainHelperForSpecs.FractionDimensionForSpecs();
     sut.DefaultScalingFor(_quantity).ShouldBeEqualTo(Scalings.Linear);
 }