protected override void Context()
        {
            base.Context();
            _enzyme1 = new IndividualEnzyme {
                Name = "CYP3A4"
            };
            _enzyme2 = new IndividualEnzyme {
                Name = "CYP2D6"
            };
            _partialProcess1Enzyme1 = new SimulationPartialProcess {
                CompoundProcess = new EnzymaticProcess {
                    MetaboliteName = "Met1"
                }, IndividualMolecule = _enzyme1
            };
            _partialProcess1Enzyme2 = new SimulationPartialProcess {
                CompoundProcess = new EnzymaticProcess {
                    MetaboliteName = "Metabolite"
                }, IndividualMolecule = _enzyme2
            };

            _partialProcesses.Add(_partialProcess1Enzyme1);
            _partialProcesses.Add(_partialProcess1Enzyme2);

            A.CallTo(() => _view.BindToPartialProcesses(A <IReadOnlyCollection <SimulationEnzymaticProcessSelectionDTO> > ._))
            .Invokes(x => _allPartialProcessDTO = x.GetArgument <IReadOnlyCollection <SimulationEnzymaticProcessSelectionDTO> >(0).ToList());

            _simulation.AddUsedBuildingBlock(new UsedBuildingBlock("Comp", PKSimBuildingBlockType.Compound)
            {
                BuildingBlock = _compound
            });
            _simulation.AddUsedBuildingBlock(new UsedBuildingBlock("Metabolite", PKSimBuildingBlockType.Compound)
            {
                BuildingBlock = new Compound().WithName("Metabolite")
            });
        }
Ejemplo n.º 2
0
 protected override void Context()
 {
     base.Context();
     _sourceMolecule = new IndividualEnzyme {
         Ontogeny = new DatabaseOntogeny()
     };
 }
Ejemplo n.º 3
0
 public override void GlobalContext()
 {
     base.GlobalContext();
     _compoundProcessRepository = IoC.Resolve <ICompoundProcessRepository>();
     _cloneManager                 = IoC.Resolve <ICloneManager>();
     _enzymeFactory                = IoC.Resolve <IIndividualEnzymeFactory>();
     _transporterFactory           = IoC.Resolve <IIndividualTransporterFactory>();
     _modelPropertiesTask          = IoC.Resolve <IModelPropertiesTask>();
     _modelConfigurationRepository = IoC.Resolve <IModelConfigurationRepository>();
     _compound   = DomainFactoryForSpecs.CreateStandardCompound();
     _individual = DomainFactoryForSpecs.CreateStandardIndividual();
     _protocol   = DomainFactoryForSpecs.CreateStandardIVBolusProtocol();
     _enzyme     = _enzymeFactory.CreateFor(_individual).DowncastTo <IndividualEnzyme>().WithName("CYP");
     _enzyme.GetRelativeExpressionNormParameterFor(CoreConstants.Compartment.Plasma).Value              = _relExpNormPls;
     _enzyme.GetRelativeExpressionNormParameterFor(CoreConstants.Compartment.BloodCells).Value          = _relExpNormBloodCells;
     _enzyme.GetRelativeExpressionNormParameterFor(CoreConstants.Compartment.VascularEndothelium).Value = _relExpVascEndo;
     _individual.AddMolecule(_enzyme);
     _hct = _individual.Organism.Parameter(CoreConstants.Parameters.HCT).Value;
     _metabolizationProcess      = _cloneManager.Clone(_compoundProcessRepository.ProcessByName(CoreConstantsForSpecs.Process.METABOLIZATION_SPECIFIC_FIRST_ORDER).DowncastTo <PartialProcess>());
     _metabolizationProcess.Name = "My Partial Process";
     _metabolizationProcess.Parameter(ConverterConstants.Parameter.CLspec).Value = 15;
     _compound.AddProcess(_metabolizationProcess);
     _simulationRunOptions = new SimulationRunOptions {
         RaiseEvents = false
     };
 }
        public override void GlobalContext()
        {
            base.GlobalContext();

            //add the molecule in global context otherwise it will be added twice
            _undefined = sut.AddUndefinedLiverTo(_individual);
        }
Ejemplo n.º 5
0
        protected override void Context()
        {
            base.Context();
            A.CallTo(() => _executionContext.Resolve <IParameterTask>()).Returns(sut);
            _relativeExpressionParameter = new Parameter
            {
                BuildingBlockType = PKSimBuildingBlockType.Individual,
                Formula           = new ConstantFormula(0.0),
                GroupName         = CoreConstants.Groups.RELATIVE_EXPRESSION,
                Name = CoreConstants.Parameters.REL_EXP
            };

            _relativeExpressionParameterNorm = new Parameter
            {
                BuildingBlockType = PKSimBuildingBlockType.Individual,
                Formula           = new ConstantFormula(0.0),
                GroupName         = CoreConstants.Groups.RELATIVE_EXPRESSION,
                Name = CoreConstants.Parameters.REL_EXP_NORM
            };

            var expressionContainer = new MoleculeExpressionContainer {
                Name = "Plasma"
            };

            expressionContainer.Add(_relativeExpressionParameter);
            expressionContainer.Add(_relativeExpressionParameterNorm);
            var molecule = new IndividualEnzyme {
                expressionContainer
            };
        }
        protected override void Context()
        {
            base.Context();
            _enzyme1 = new IndividualEnzyme {
                Name = "CYP3A4"
            };
            _enzyme2 = new IndividualEnzyme {
                Name = "CYP2D6"
            };
            _partialProcess1Enzyme1 = new SimulationPartialProcess {
                CompoundProcess = new EnzymaticProcess(), IndividualMolecule = _enzyme1
            };
            _partialProcess1Enzyme2 = new SimulationPartialProcess {
                CompoundProcess = new EnzymaticProcess(), IndividualMolecule = _enzyme2
            };
            _partialProcess1Enzyme3 = new SimulationPartialProcess {
                CompoundProcess = new EnzymaticProcess(), IndividualMolecule = _enzyme2
            };

            _partialProcesses.Add(_partialProcess1Enzyme1);
            _partialProcesses.Add(_partialProcess1Enzyme2);
            _partialProcesses.Add(_partialProcess1Enzyme3);

            A.CallTo(() => _view.BindToPartialProcesses(A <IReadOnlyCollection <SimulationEnzymaticProcessSelectionDTO> > ._))
            .Invokes(x => _allPartialProcessDTO = x.GetArgument <IReadOnlyCollection <SimulationEnzymaticProcessSelectionDTO> >(0).ToList());

            sut.EditProcessesIn(_simulation, _compoundProperties);
        }
 protected override void Context()
 {
     base.Context();
     _enzyme1 = new IndividualOtherProtein().WithName("_enzyme1");
     _enzyme2 = new IndividualEnzyme().WithName("_enzyme2");
     sut.AddMolecule(_enzyme1);
     sut.AddMolecule(_enzyme2);
 }
Ejemplo n.º 8
0
        public static IndividualMolecule DefaultIndividualMolecule()
        {
            var molecule = new IndividualEnzyme();

            molecule.Add(ConstantParameterWithValue(10).WithName(CoreConstants.Parameter.REFERENCE_CONCENTRATION));
            molecule.Add(ConstantParameterWithValue(20).WithName(CoreConstants.Parameter.HALF_LIFE_LIVER));
            molecule.Add(ConstantParameterWithValue(30).WithName(CoreConstants.Parameter.HALF_LIFE_INTESTINE));
            return(molecule);
        }
 protected override void Context()
 {
     _context             = A.Fake <IExecutionContext>();
     _enzyme              = A.Fake <IndividualEnzyme>();
     _value               = 5;
     _parameterExpression = DomainHelperForSpecs.ConstantParameterWithValue(2);
     A.CallTo(() => _context.BuildingBlockContaining(_parameterExpression)).Returns(A.Fake <IPKSimBuildingBlock>());
     sut = new SetRelativeExpressionCommand(_parameterExpression, _value);
 }
Ejemplo n.º 10
0
        protected override Task Context()
        {
            _parameterMapper     = A.Fake <ParameterMapper>();
            _moleculeMapper      = A.Fake <MoleculeMapper>();
            _dimensionRepository = A.Fake <IDimensionRepository>();
            _individualFactory   = A.Fake <IIndividualFactory>();
            _originDataMapper    = A.Fake <OriginDataMapper>();

            sut = new IndividualMapper(_parameterMapper, _moleculeMapper, _originDataMapper, _individualFactory);

            _individual             = DomainHelperForSpecs.CreateIndividual();
            _individual.Name        = "Ind";
            _individual.Description = "Model Description";

            _parameterLiver  = _individual.EntityAt <IParameter>(Constants.ORGANISM, CoreConstants.Organ.Liver, "PLiver");
            _parameterKidney = _individual.EntityAt <IParameter>(Constants.ORGANISM, CoreConstants.Organ.Kidney, "PKidney");

            _parameterLiver.ValueDiffersFromDefault().ShouldBeFalse();
            _parameterKidney.ValueDiffersFromDefault().ShouldBeFalse();

            _parameterKidney.Value = 40;
            _parameterKidney.ValueDiffersFromDefault().ShouldBeTrue();

            _enzyme = new IndividualEnzyme
            {
                Name = "Enz",
            };
            _individual.AddMolecule(_enzyme);

            _transporter = new IndividualTransporter
            {
                Name = "Trans",
            };

            _individual.AddMolecule(_transporter);

            _enzymeSnapshot = new Molecule {
                Type = QuantityType.Enzyme
            };
            _transporterSnapshot = new Molecule {
                Type = QuantityType.Transporter
            };

            A.CallTo(() => _moleculeMapper.MapToSnapshot(_enzyme)).Returns(_enzymeSnapshot);
            A.CallTo(() => _moleculeMapper.MapToSnapshot(_transporter)).Returns(_transporterSnapshot);

            _originDataSnapshot = new OriginData();
            A.CallTo(() => _originDataMapper.MapToSnapshot(_individual.OriginData)).Returns(_originDataSnapshot);

            _localizedParameterKidney = new LocalizedParameter {
                Path = "Organism|Kidney|PKidney"
            };
            A.CallTo(() => _parameterMapper.LocalizedParametersFrom(A <IEnumerable <IParameter> > .That.Contains(_parameterKidney))).Returns(new[] { _localizedParameterKidney });

            return(_completed);
        }
 protected override void Context()
 {
     base.Context();
     _protein = A.Fake <IndividualProtein>();
     _enzyme  = A.Fake <IndividualEnzyme>();
     _moleculeList.AddRange(new[] { _protein, _enzyme });
     _enzymeList.Add(_enzyme);
     _enzymeNode = A.Fake <ITreeNode <IndividualEnzyme> >();
     A.CallTo(() => _treeNodeFactory.CreateFor(_enzyme)).Returns(_enzymeNode);
 }
Ejemplo n.º 12
0
 protected override void Context()
 {
     base.Context();
     _enzyme = A.Fake <IndividualEnzyme>();
     A.CallTo(() => _enzyme.Rules).Returns(A.Fake <IBusinessRuleSet>());
     _enzyme.Name = "CYP";
     _container1  = new MoleculeExpressionContainer();
     _container2  = new MoleculeExpressionContainer();
     A.CallTo(() => _enzyme.GetChildren <IMoleculeExpressionContainer>()).Returns(new[] { _container1, _container2 });
 }
Ejemplo n.º 13
0
 protected override void Context()
 {
     base.Context();
     _enzyme = new IndividualEnzyme {
         Name = "CYP"
     };
     _container1 = new MoleculeExpressionContainer().WithName("EXP1");
     _container2 = new MoleculeExpressionContainer().WithName("EXP2");
     _enzyme.AddChildren(_container1, _container2);
 }
Ejemplo n.º 14
0
 protected override void Context()
 {
     base.Context();
     _cloneManager   = A.Fake <ICloneManager>();
     _sourceMolecule = new IndividualEnzyme {
         Ontogeny = new UserDefinedOntogeny()
     };
     _clonedOntogeny = new UserDefinedOntogeny();
     A.CallTo(() => _cloneManager.Clone(_sourceMolecule.Ontogeny)).Returns(_clonedOntogeny);
 }
Ejemplo n.º 15
0
 protected override void Context()
 {
     _moleculeParameterRepository = A.Fake <IMoleculeParameterRepository>();
     sut       = new MoleculeParameterTask(_moleculeParameterRepository);
     _molecule = new IndividualEnzyme {
         Name = "CYP3A4"
     };
     _molecule.Add(DomainHelperForSpecs.ConstantParameterWithValue(10).WithName(CoreConstants.Parameters.REFERENCE_CONCENTRATION));
     _molecule.Add(DomainHelperForSpecs.ConstantParameterWithValue(20).WithName(CoreConstants.Parameters.HALF_LIFE_LIVER));
     _molecule.Add(DomainHelperForSpecs.ConstantParameterWithValue(30).WithName(CoreConstants.Parameters.HALF_LIFE_INTESTINE));
 }
Ejemplo n.º 16
0
        protected EnzymaticProcess AddEnzymaticProcess(Compound compound, IndividualEnzyme enzyme)
        {
            var compoundProcessRepository = IoC.Resolve <ICompoundProcessRepository>();
            var cloneManager     = IoC.Resolve <ICloneManager>();
            var enzymaticProcess = cloneManager.Clone(compoundProcessRepository.ProcessByName(CoreConstantsForSpecs.Process.METABOLIZATION_SPECIFIC_FIRST_ORDER).DowncastTo <EnzymaticProcess>());

            enzymaticProcess.Name         = "My Partial Process " + enzyme.Name;
            enzymaticProcess.MoleculeName = enzyme.Name;
            enzymaticProcess.Parameter(ConverterConstants.Parameters.CLspec).Value = 10;
            compound.AddProcess(enzymaticProcess);
            return(enzymaticProcess);
        }
Ejemplo n.º 17
0
        public override void GlobalContext()
        {
            base.GlobalContext();
            _compound   = DomainFactoryForSpecs.CreateStandardCompound().WithName("Parent");
            _metabolite = DomainFactoryForSpecs.CreateStandardCompound().WithName("Metabolite");
            _individual = DomainFactoryForSpecs.CreateStandardIndividual();
            _protocol   = DomainFactoryForSpecs.CreateStandardIVBolusProtocol();

            _cyp3A4 = AddEnzymeTo(_individual, "CYP3A4");
            _parentMetabolizationCYP3A4 = AddEnzymaticProcess(_compound, _cyp3A4);

            _cyp2D6 = AddEnzymeTo(_individual, "CYP2D6");
            _parentMetabolizationCYP2D6 = AddEnzymaticProcess(_compound, _cyp2D6);
        }
Ejemplo n.º 18
0
        public override void GlobalContext()
        {
            base.GlobalContext();
            var enzymeFactory      = IoC.Resolve <IIndividualEnzymeFactory>();
            var templateIndividual = DomainFactoryForSpecs.CreateStandardIndividual();
            var compound           = DomainFactoryForSpecs.CreateStandardCompound();
            var protocol           = DomainFactoryForSpecs.CreateStandardIVBolusProtocol();

            _enzyme = enzymeFactory.CreateFor(templateIndividual).DowncastTo <IndividualEnzyme>().WithName("CYP");
            templateIndividual.AddMolecule(_enzyme);

            _simulation = DomainFactoryForSpecs.CreateModelLessSimulationWith(templateIndividual, compound, protocol).DowncastTo <IndividualSimulation>();

            DomainFactoryForSpecs.AddModelToSimulation(_simulation);
        }
Ejemplo n.º 19
0
 public override void GlobalContext()
 {
     base.GlobalContext();
     _withIdRepository    = IoC.Resolve <IWithIdRepository>();
     _simulation          = new IndividualSimulation().WithId("Sim");
     _simulation.IsLoaded = true;
     _withIdRepository.Register(_simulation);
     _simulation.AddUsedBuildingBlock(new UsedBuildingBlock("Ind", PKSimBuildingBlockType.Individual)
     {
         BuildingBlock = DomainHelperForSpecs.CreateIndividual()
     });
     _transporter = new IndividualTransporter().WithName("Trans");
     _enzyme      = new IndividualEnzyme().WithName("Enz");
     _simulation.Individual.AddMolecule(_transporter);
     _simulation.Individual.AddMolecule(_enzyme);
 }
Ejemplo n.º 20
0
        protected override void Context()
        {
            base.Context();
            _pp1 = A.Fake <EnzymaticProcess>().WithName("pp1");
            _pp1.MoleculeName = "enzyme1";

            _pp2 = A.Fake <EnzymaticProcess>().WithName("pp2");
            _pp2.MoleculeName = "enzyme1";

            _pp3 = A.Fake <EnzymaticProcess>().WithName("pp3");
            _pp3.MoleculeName = "enzyme3";

            _pp4 = A.Fake <EnzymaticProcess>().WithName("pp4");
            _pp4.MoleculeName = "enzyme4";

            _pp5 = A.Fake <EnzymaticProcess>().WithName("pp5");
            _pp5.MoleculeName = "enzyme5";

            _unknowProteinName = "unknow";
            _moleculeName      = "TITI";

            _compound.AddProcess(_pp1);
            _compound.AddProcess(_pp2);
            _compound.AddProcess(_pp3);
            _compound.AddProcess(_pp4);
            _compound.AddProcess(_pp5);
            _enzyme           = A.Fake <IndividualEnzyme>().WithName(_pp3.MoleculeName);
            _anotherProtein   = A.Fake <IndividualEnzyme>().WithName(_moleculeName);
            _notMappedProtein = A.Fake <IndividualEnzyme>().WithName("not mapped");
            _individual.AddMolecule(_enzyme);
            _individual.AddMolecule(_anotherProtein);
            _individual.AddMolecule(_notMappedProtein);

            _availableProcesses = new List <ProcessSelection>
            {
                new ProcessSelection {
                    ProcessName = _pp3.Name, MoleculeName = _notMappedProtein.Name, CompoundName = "DOES NOT EXIST"
                },
                new ProcessSelection {
                    ProcessName = _pp4.Name, MoleculeName = _moleculeName, CompoundName = _compound.Name
                },
                new ProcessSelection {
                    ProcessName = _pp5.Name, MoleculeName = _unknowProteinName, CompoundName = _compound.Name
                }
            };
        }
Ejemplo n.º 21
0
        public override void GlobalContext()
        {
            base.GlobalContext();
            _individual             = DomainFactoryForSpecs.CreateStandardIndividual();
            _moleculeExpressionTask = IoC.Resolve <IMoleculeExpressionTask <Individual> >();
            _ontogenyRepository     = IoC.Resolve <IOntogenyRepository>();

            _expressionProfileForEnzyme = DomainFactoryForSpecs.CreateExpressionProfile <IndividualEnzyme>();
            _moleculeExpressionTask.AddExpressionProfile(_individual, _expressionProfileForEnzyme);
            _individualEnzyme        = _individual.MoleculeByName <IndividualEnzyme>(_expressionProfileForEnzyme.MoleculeName);
            _expressionProfileEnzyme = _expressionProfileForEnzyme.Molecule.DowncastTo <IndividualEnzyme>();

            _expressionProfileForTransporter = DomainFactoryForSpecs.CreateExpressionProfile <IndividualTransporter>(moleculeName: "TRANS");
            _moleculeExpressionTask.AddExpressionProfile(_individual, _expressionProfileForTransporter);
            _individualTransporter        = _individual.MoleculeByName <IndividualTransporter>(_expressionProfileForTransporter.MoleculeName);
            _expressionProfileTransporter = _expressionProfileForTransporter.Molecule.DowncastTo <IndividualTransporter>();
        }
        protected override void Context()
        {
            _interactionProcessRetriever = A.Fake <IInteractionProcessRetriever>();
            _view = A.Fake <ISimulationCompoundInteractionSelectionView>();
            sut   = new SimulationCompoundInteractionSelectionPresenter(_view, _interactionProcessRetriever);

            _interactionProperties             = new InteractionProperties();
            _allSimulationInteractionProcesses = new List <SimulationPartialProcess>();
            _simulation = A.Fake <Simulation>();
            var individual = new Individual().WithName("Enzyme");

            _molecule1      = new IndividualEnzyme().WithName("CYP3A4");
            _undefinedLiver = new IndividualEnzyme().WithName(CoreConstants.Molecule.UndefinedLiver);
            individual.AddMolecule(_molecule1);
            individual.AddMolecule(_undefinedLiver);

            _interactionProcess1 = new InhibitionProcess().WithName("INTERACTION1");
            _interactionProcess2 = new InhibitionProcess().WithName("INTERACTION2");
            _interactionProcess3 = new InhibitionProcess().WithName("INTERACTION3");
            var comp1 = new Compound();

            comp1.AddProcess(_interactionProcess1);
            var comp2 = new Compound();

            comp2.AddProcess(_interactionProcess2);
            comp2.AddProcess(_interactionProcess3);

            _allSimulationInteractionProcesses.Add(new SimulationPartialProcess {
                CompoundProcess = _interactionProcess1, IndividualMolecule = _molecule1
            });
            _allSimulationInteractionProcesses.Add(new SimulationPartialProcess {
                CompoundProcess = _interactionProcess2, IndividualMolecule = _molecule1
            });

            A.CallTo(() => _simulation.InteractionProperties).Returns(_interactionProperties);
            A.CallTo(() => _simulation.Individual).Returns(individual);
            A.CallTo(() => _simulation.Compounds).Returns(new[] { comp1, comp2 });

            A.CallTo(_interactionProcessRetriever).WithReturnType <IReadOnlyList <SimulationPartialProcess> >()
            .Invokes(x => _useDefaultMap = x.GetArgument <bool>(2))
            .Returns(_allSimulationInteractionProcesses);

            A.CallTo(() => _view.BindTo(A <IEnumerable <SimulationInteractionProcessSelectionDTO> > ._))
            .Invokes(x => _allSimulationInteractionProcessSelectionDTO = x.GetArgument <IEnumerable <SimulationInteractionProcessSelectionDTO> >(0));
        }
        protected override void Context()
        {
            base.Context();
            _moleculeMappable        = new IndividualEnzyme().WithName("MoleculeMapped");
            _moleculeAlreadySelected = new IndividualEnzyme().WithName("MoleculeAlreadySelected");
            _moleculeNotMapped       = new IndividualEnzyme().WithName("MoleculeNotMapped");
            _inhibitionProcess1      = new InhibitionProcess().WithName("InhibitionProcess1");
            _inhibitionProcess2      = new InhibitionProcess().WithName("InhibitionProcess2");
            _inductionProcess1       = new InductionProcess().WithName("InductionProcess1");
            _inhibitionProcess3      = new InhibitionProcess().WithName("InhibitionProcess3");

            _individual.AddMolecule(_moleculeNotMapped);
            _individual.AddMolecule(_moleculeMappable);
            _individual.AddMolecule(_moleculeAlreadySelected);

            _compound.AddProcess(_inhibitionProcess1);

            _compound2 = new Compound().WithName("Comp2");
            _compound2.AddProcess(_inhibitionProcess2);
            _inhibitionProcess2.MoleculeName = _moleculeMappable.Name;

            _compound2.AddProcess(_inhibitionProcess3);
            _inhibitionProcess3.MoleculeName = _moleculeMappable.Name;

            _compound2.AddProcess(_inductionProcess1);
            _inductionProcess1.MoleculeName = _moleculeMappable.Name;

            var interactionProperties = new InteractionProperties();

            interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _moleculeAlreadySelected.Name, ProcessName = _inhibitionProcess1.Name, CompoundName = _compound.Name
            });

            A.CallTo(() => _simulation.InteractionProperties).Returns(interactionProperties);
            A.CallTo(() => _simulation.Compounds).Returns(new[] { _compound, _compound2 });
        }
        protected override void Context()
        {
            _view = A.Fake <IIndividualProteinExpressionsView>();
            _individualProteinMapper         = A.Fake <IIndividualProteinToIndividualProteinDTOMapper>();
            _moleculesPropertiesPresenter    = A.Fake <IIndividualMoleculePropertiesPresenter <Individual> >();
            _expressionLocalizationPresenter = A.Fake <IExpressionLocalizationPresenter <Individual> >();
            _expressionParametersPresenter   = A.Fake <IExpressionParametersPresenter>();

            sut = new IndividualEnzymeExpressionsPresenter <Individual>(
                _view, _individualProteinMapper,
                _moleculesPropertiesPresenter,
                _expressionLocalizationPresenter,
                _expressionParametersPresenter);


            _individual           = new Individual();
            sut.SimulationSubject = _individual;


            _enzyme = new IndividualEnzyme().WithName("CYP3A4");

            _enzymeDTO            = new IndividualProteinDTO(_enzyme);
            _initialConcentration = createParameter(INITIAL_CONCENTRATION);
            _relativeExpression   = createParameter(REL_EXP);
            _relativeExpression2  = createParameter(REL_EXP);
            _fraction_exp_bc      = createParameter(FRACTION_EXPRESSED_BLOOD_CELLS);
            _enzymeDTO.AddExpressionParameter(_initialConcentration);
            _enzymeDTO.AddExpressionParameter(_relativeExpression);
            _enzymeDTO.AddExpressionParameter(_fraction_exp_bc);
            A.CallTo(() => _individualProteinMapper.MapFrom(_enzyme, _individual)).Returns(_enzymeDTO);
            A.CallTo(() => _expressionParametersPresenter.Edit(A <IReadOnlyList <ExpressionParameterDTO> > ._))
            .Invokes(x => _allParameters = x.GetArgument <IReadOnlyList <ExpressionParameterDTO> >(0).ToList());


            sut.ActivateMolecule(_enzyme);
        }
 protected override void Context()
 {
     sut = new IndividualEnzyme();
 }
Ejemplo n.º 26
0
 protected override async Task Because()
 {
     _newMolecule = await sut.MapToModel(_snapshot, _individual) as IndividualEnzyme;
 }
 protected override void Because()
 {
     _undefined = sut.UndefinedLiverFor(_individual);
 }
Ejemplo n.º 28
0
        protected override Task Context()
        {
            _parameterMapper                   = A.Fake <ParameterMapper>();
            _expressionContainerMapper         = A.Fake <ExpressionContainerMapper>();
            _executionContext                  = A.Fake <IExecutionContext>();
            _individualMoleculeFactoryResolver = A.Fake <IIndividualMoleculeFactoryResolver>();
            _ontogenyMapper = A.Fake <OntogenyMapper>();
            _ontogenyTask   = A.Fake <IOntogenyTask <Individual> >();
            _individualMoleculeParametersTask = A.Fake <IMoleculeParameterTask>();

            sut = new MoleculeMapper(_parameterMapper, _expressionContainerMapper,
                                     _ontogenyMapper, _individualMoleculeFactoryResolver, _executionContext, _ontogenyTask, _individualMoleculeParametersTask);

            _ontogeny = new DatabaseOntogeny
            {
                Name = "Ontogeny"
            };

            _enzyme = new IndividualEnzyme
            {
                Name        = "Enzyme",
                Description = "Help",
                Ontogeny    = _ontogeny,
            };

            _transporter = new IndividualTransporter
            {
                Name        = "Transporter",
                Description = "Help"
            };

            _otherProtein = new IndividualOtherProtein
            {
                Name        = "OtherProtein",
                Description = "Help"
            };

            _enzymeGlobalParameter         = DomainHelperForSpecs.ConstantParameterWithValue(5, isDefault: true).WithName(CoreConstants.Parameters.HALF_LIFE_LIVER);
            _enzymeGlobalParameterSnapshot = new Parameter();

            A.CallTo(() => _parameterMapper.MapToSnapshot(_enzymeGlobalParameter)).Returns(_enzymeGlobalParameterSnapshot);

            _expressionContainer1 = new MoleculeExpressionContainer {
                Name = "Exp Container1"
            };
            _expressionContainer2 = new MoleculeExpressionContainer {
                Name = "Exp Container2"
            };
            _enzyme.AddChildren(_expressionContainer1, _expressionContainer2, _enzymeGlobalParameter);

            _relativeExpressionParameter1     = DomainHelperForSpecs.ConstantParameterWithValue(0.5).WithName(CoreConstants.Parameters.REL_EXP);
            _relativeExpressionParameterNorm1 = DomainHelperForSpecs.ConstantParameterWithValue(1).WithName(CoreConstants.Parameters.REL_EXP_NORM);
            _expressionContainer1.Add(_relativeExpressionParameter1);
            _expressionContainer1.Add(_relativeExpressionParameterNorm1);

            _relativeExpressionParameterNotSet     = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.REL_EXP);
            _relativeExpressionParameterNotSetNorm = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.REL_EXP_NORM);
            _expressionContainer2.Add(_relativeExpressionParameterNotSet);
            _expressionContainer2.Add(_relativeExpressionParameterNotSetNorm);

            _relativeExpressionContainerSnapshot1 = new ExpressionContainer();
            _relativeExpressionContainerSnapshot2 = new ExpressionContainer();

            A.CallTo(() => _expressionContainerMapper.MapToSnapshot(_expressionContainer1)).Returns(_relativeExpressionContainerSnapshot1);
            A.CallTo(() => _expressionContainerMapper.MapToSnapshot(_expressionContainer2)).Returns(_relativeExpressionContainerSnapshot2);

            _snapshotOntogeny = new Snapshots.Ontogeny();
            A.CallTo(() => _ontogenyMapper.MapToSnapshot(_ontogeny)).Returns(_snapshotOntogeny);
            _individual = new Individual();

            return(_completed);
        }