protected override void Context() { base.Context(); _amountPerTimeDimension = A.Fake <IDimension>(); _transporterMoleculeContainer = new TransporterMoleculeContainer(); A.CallTo(() => _interactionTaskContext.DimensionByName(Constants.Dimension.AMOUNT_PER_TIME)).Returns(_amountPerTimeDimension); }
private IContainer addActiveTransportToNeighborhood(INeighborhood neighborhood, ITransport transport, TransporterMoleculeContainer transporterMolecule, string transportedMoleculeName, IBuildConfiguration buildConfiguration) { return(_moleculePropertiesContainerTask.NeighborhoodMoleculeTransportContainerFor(neighborhood, transportedMoleculeName, transporterMolecule, transport.Name, buildConfiguration) .WithChild(transport)); }
protected override void Context() { _quantity = A.Fake <IParameter>().WithName("P"); base.Context(); _parameter.Name = "P"; var moleculeBuilder1 = new MoleculeBuilder().WithName("Mol1"); var moleculeBuilder2 = new MoleculeBuilder().WithName("Mol2"); var transporterMolecule1 = new TransporterMoleculeContainer { TransportName = "TRANSPORT", Name = "TRANSPORTER" }; var molecule1 = new Container().WithName("Mol1"); molecule1.Add(transporterMolecule1); var molecule2 = new Container().WithName("Mol2"); var transporterMolecule2 = new TransporterMoleculeContainer { TransportName = "TRANSPORT", Name = "TRANSPORTER" }; molecule2.Add(transporterMolecule2); moleculeBuilder1.AddTransporterMoleculeContainer(transporterMolecule1); moleculeBuilder2.AddTransporterMoleculeContainer(transporterMolecule2); var moleculeBuildingBlock = new MoleculeBuildingBlock { moleculeBuilder1, moleculeBuilder2 }; _buildingBlockInfo.UntypedBuildingBlock = moleculeBuildingBlock; transporterMolecule1.AddParameter(_parameter); _quantity.ParentContainer.Name = transporterMolecule1.TransportName; _quantity.ParentContainer.ParentContainer.Name = moleculeBuilder1.Name; }
protected override void Context() { _formulaCache = A.Fake <IFormulaCache>(); _repository = A.Fake <IRepository <IInteractionKineticUpdaterSpecification> >(); _objectBaseFactory = A.Fake <IObjectBaseFactory>(); A.CallTo(() => _objectBaseFactory.Create <ExplicitFormula>()).ReturnsLazily(x => new ExplicitFormula()); A.CallTo(() => _repository.All()).Returns(_allKineticUpdaterSpecifications); sut = new InteractionKineticUpdater(_repository, _objectBaseFactory); _reaction = new ReactionBuilder(); _transporterMoleculeContainer = new TransporterMoleculeContainer(); _simulation = A.Fake <Simulation>(); _interactionProperties = new InteractionProperties(); _interactionProperties.AddInteraction(new InteractionSelection { MoleculeName = _enzymeName, ProcessName = _processName }); A.CallTo(() => _simulation.InteractionProperties).Returns(_interactionProperties); _kmFactor = new PKSimParameter().WithName(CoreConstants.Parameter.KM_INTERACTION_FACTOR).WithFormula(new ExplicitFormula("1")); _vmaxFactor = new PKSimParameter().WithName(CoreConstants.Parameter.KCAT_INTERACTION_FACTOR).WithFormula(new ExplicitFormula("1")); _reaction.Add(_kmFactor); _reaction.Add(_vmaxFactor); _transporterMoleculeContainer.Add(_kmFactor); _transporterMoleculeContainer.Add(_vmaxFactor); }
public ObjectBaseDTO MapFrom(TransporterMoleculeContainer transporterMoleculeContainer) { var dto = Map <ObjectBaseDTO>(transporterMoleculeContainer); dto.Name = transporterMoleculeContainer.TransportName; return(dto); }
protected override void Context() { base.Context(); _parent = new MoleculeBuilder().WithName("Drug"); _interactionContainer = new InteractionContainer().WithParentContainer(_parent); _parameter = new Parameter().WithName("P1").WithParentContainer(_parent); _transporterMolecule = new TransporterMoleculeContainer().WithName("PGP").WithParentContainer(_parent); }
public TransporterMoleculeContainerDTO MapFrom(TransporterMoleculeContainer transporterMoleculeContainer) { var dto = Map <TransporterMoleculeContainerDTO>(transporterMoleculeContainer); dto.TransportName = transporterMoleculeContainer.TransportName; dto.Realizations = transporterMoleculeContainer.ActiveTransportRealizations.MapAllUsing(_activeTransportToDTOActiveTransportBuilderMapper); dto.Parameters = transporterMoleculeContainer.Parameters.MapAllUsing(_parameterBuilderToDTOParameterBuilderMapper).Cast <ParameterDTO>(); return(dto); }
protected override void Context() { base.Context(); _clSpecFactor = new Parameter().WithFormula(new ExplicitFormula()); _transporterMoleculeContainer = new TransporterMoleculeContainer(); _interactionProperties.ClearInteractions(); _interactionProperties.AddInteraction(new InteractionSelection { MoleculeName = _moleculeName, ProcessName = _competitiveInhibition2.Name, CompoundName = _compound2.Name }); }
protected override void Context() { base.Context(); _activeTransportBuilderContainer = new TransporterMoleculeContainer(); _buildingBlock = A.Fake <IMoleculeBuildingBlock>(); _dto = new TransporterMoleculeContainerDTO(); A.CallTo(() => _transporterMoleculeContainerMapper.MapFrom(_activeTransportBuilderContainer)).Returns(_dto); sut.BuildingBlock = _buildingBlock; sut.Edit(_activeTransportBuilderContainer); }
protected override void Context() { base.Context(); _transporterMoleculeContainer = A.Fake <TransporterMoleculeContainer>(); _transporterMoleculeContainer.Name = "Cyp"; _parameter = A.Fake <IParameter>(); _transporter = A.Fake <ITransportBuilder>(); A.CallTo(() => _transporterMoleculeContainer.ActiveTransportRealizations).Returns(new [] { _transporter }); A.CallTo(() => _transporterMoleculeContainer.Parameters).Returns(new[] { _parameter }); }
public void Visit(TransporterMoleculeContainer transporterMoleculeContainer) { checkObjectBase(transporterMoleculeContainer); if (!string.Equals(_oldName, transporterMoleculeContainer.TransportName)) { return; } _changes.Add(transporterMoleculeContainer, _buildingBlock, new EditObjectBasePropertyInBuildingBlockCommand(_tranportNamePropertyName, _newName, _oldName, transporterMoleculeContainer, _buildingBlock), AppConstants.Commands.EditDescription(_objectTypeResolver.TypeFor <TransporterMoleculeContainer>(), _tranportNamePropertyName, _oldName, _newName, transporterMoleculeContainer.Name)); }
private void addActiveTransportToModel(IModel model, ITransportBuilder activeTransportBuilder, IEnumerable <INeighborhood> allNeighborhoods, IMoleculeBuilder molecule, TransporterMoleculeContainer transporterMolecule, IBuildConfiguration buildConfiguration) { var neighborhoods = getNeighborhoodsForActiveTransport(activeTransportBuilder, allNeighborhoods, molecule.Name, transporterMolecule.Name); foreach (var neighborhood in neighborhoods) { var activeTransport = mapFrom(activeTransportBuilder, neighborhood, molecule.Name, buildConfiguration); var activeTransportInMolecule = addActiveTransportToNeighborhood(neighborhood, activeTransport, transporterMolecule, molecule.Name, buildConfiguration); buildConfiguration.AddBuilderReference(activeTransportInMolecule, activeTransportBuilder); _keywordReplacerTask.ReplaceIn(activeTransport, model.Root, molecule.Name, neighborhood, transporterMolecule.TransportName, transporterMolecule.Name); } }
protected override void Context() { base.Context(); _moleculeBuilder = A.Fake <IMoleculeBuilder>(); _startFormula = A.Fake <IFormula>(); _moleculeBuilder.DefaultStartFormula = _startFormula; _moleculeBuilder.Description = "Description"; _moleculeBuilder.Icon = "Icon"; _moleculeBuilder.Id = "ID"; _moleculeBuilder.IsFloating = true; _moleculeBuilder.QuantityType = QuantityType.Drug; _activeTransport = A.Fake <ITransportBuilder>(); _transporterMoleculeContainer = A.Fake <TransporterMoleculeContainer>(); A.CallTo(() => _moleculeBuilder.TransporterMoleculeContainerCollection).Returns(new[] { _transporterMoleculeContainer }); A.CallTo(() => _transporterMoleculeContainer.ActiveTransportRealizations).Returns(new[] { _activeTransport }); _parameter = A.Fake <IParameter>(); A.CallTo(() => _moleculeBuilder.Parameters).Returns(new[] { _parameter }); _calculationMethod = A.Fake <UsedCalculationMethod>(); A.CallTo(() => _moleculeBuilder.UsedCalculationMethods).Returns(new[] { _calculationMethod }); _interactionContainer = A.Fake <InteractionContainer>(); A.CallTo(() => _moleculeBuilder.InteractionContainerCollection).Returns(new[] { _interactionContainer }); }
public void Visit(TransporterMoleculeContainer transporterMoleculeContainer) { addNamesToHash(_nameHashForVisitor, For(transporterMoleculeContainer)); }
public void UpdateTransport(TransporterMoleculeContainer transporterMoleculeContainer, string compoundName, string transportedMolecule, Simulation simulation, IFormulaCache formulaCache) { updateProcess(transporterMoleculeContainer, compoundName, transportedMolecule, simulation, formulaCache); }
protected IMenuBarItem CreateRenameItemFor(TransporterMoleculeContainer objectToEdit) { return(CreateMenuButton.WithCaption(AppConstants.MenuNames.Rename) .WithCommandFor <RenameObjectCommand <TransporterMoleculeContainer>, TransporterMoleculeContainer>(objectToEdit) .WithIcon(ApplicationIcons.Rename)); }
protected virtual IMenuBarItem CreateRemoveItemFor(TransporterMoleculeContainer objectToEdit) { return(CreateMenuButton.WithCaption(AppConstants.MenuNames.Delete) .WithRemoveCommand(objectToEdit.ParentContainer.DowncastTo <IMoleculeBuilder>(), objectToEdit) .WithIcon(ApplicationIcons.Delete)); }
public IEnumerable <string> For(TransporterMoleculeContainer transporterMoleculeContainer) { return(allLocalParametersFromMoleculesInProject()); }
protected virtual IMenuBarItem CreateAddExistingFromTemplateTransportFor(TransporterMoleculeContainer selectedObject) { return(CreateMenuButton.WithCaption(AppConstants.MenuNames.AddExistingFromTemplate("Transport")) .WithCommandFor <AddExistingFromTemplateCommandFor <TransporterMoleculeContainer, ITransportBuilder>, TransporterMoleculeContainer>(selectedObject) .WithIcon(ApplicationIcons.LoadFromTemplate)); }
public IContainer NeighborhoodMoleculeTransportContainerFor(INeighborhood neighborhood, string transportedMoleculeName, TransporterMoleculeContainer transporterMolecule, string transportName, IBuildConfiguration buildConfiguration) { var moleculeContainer = NeighborhoodMoleculeContainerFor(neighborhood, transportedMoleculeName); var transportContainer = moleculeContainer.EntityAt <IContainer>(transporterMolecule.TransportName); if (transportContainer != null) { return(transportContainer); } return(_containerTask.CreateOrRetrieveSubContainerByName(moleculeContainer, transporterMolecule.TransportName) .WithChildren(allLocalParametersFrom(transporterMolecule, buildConfiguration))); }