protected override void Context() { base.Context(); sut.Add(new MatchAllCondition()); _descriptorCondition = new MatchTagCondition("tata"); sut.Add(_descriptorCondition); }
protected override void Context() { base.Context(); _context = A.Fake <IMoBiContext>(); _tagCondition = new MatchTagCondition(_oldTag); _sumFormula.Criteria.Add(_tagCondition); }
protected override void Context() { base.Context(); _entity = new Parameter().WithName("para"); var cond1 = new MatchTagCondition(_entity.Name); sut.Add(cond1); }
public void TestSerialization() { MatchTagCondition x1 = new MatchTagCondition("Franz"); MatchTagCondition x2 = SerializeAndDeserialize(x1); AssertForSpecs.AreEqualMatchTagCondition(x2, x1); }
protected override void Context() { base.Context(); _descriptorCondition = new MatchTagCondition("toto"); sut.Add(_descriptorCondition); _inContainerCondition = new InContainerCondition(_descriptorCondition.Tag); sut.Add(_inContainerCondition); sut.Add(new MatchTagCondition("titi")); }
protected override Task Context() { _logger = A.Fake <IOSPSuiteLogger>(); sut = new DescriptorConditionMapper(_logger); _inContainer = new InContainerCondition("CONT"); _notInContainer = new NotInContainerCondition("NOT_CONT"); _matchAllCondition = new MatchAllCondition(); _notMatchAllCondition = new NotMatchTagCondition("NOT_MATCH"); _notMatchCondition = new MatchTagCondition("MATCH"); return(_completed); }
/// <summary> /// Creates a EventGroupBuildingBlock and a EventGroupBuilder. /// </summary> internal void CreateEGBandEGBB() { EventGroupBuilder = new EventGroupBuilder() .WithName(SBMLConstants.SBML_EVENTS) .WithId(SBMLConstants.SBML_EVENTS); var eventsContainer = GetEventsTopContainer(); if (eventsContainer != null) { var matchTag = new MatchTagCondition(eventsContainer.Name); EventGroupBuilder.SourceCriteria.Add(matchTag); } EventGroupBuildingBlock = new EventGroupBuildingBlock() .WithName(SBMLConstants.SBML_EVENT_BB) .WithId(SBMLConstants.SBML_EVENT_BB); EventGroupBuildingBlock.Add(EventGroupBuilder); }
/// <summary> /// Imports a SBML Reaction by creating a passive Transport. /// </summary> private void CreatePassiveTransport(Reaction sbmlReaction, Model model) { var reactant = sbmlReaction.getReactant(0).getSpecies(); var product = sbmlReaction.getProduct(0).getSpecies(); var reactantSpecies = GetSpeciesById(reactant, model); var productSpecies = GetSpeciesById(product, model); if (_sbmlInformation.MoleculeInformation.All(info => info.SpeciesIds.TrueForAll(s => s != reactant))) { return; } if (_sbmlInformation.MoleculeInformation.All(info => info.SpeciesIds.TrueForAll(s => s != product))) { return; } var molInfoReactant = _sbmlInformation.MoleculeInformation.FirstOrDefault(info => info.SpeciesIds.Contains(reactant)); var molInfoProduct = _sbmlInformation.MoleculeInformation.FirstOrDefault(info => info.SpeciesIds.Contains(product)); if (molInfoProduct == null) { return; } if (molInfoReactant == null) { return; } //must be the same Molecule if (molInfoReactant.GetMoleculeBuilder() != molInfoProduct.GetMoleculeBuilder()) { CreateErrorMessage(); } var passiveTransport = ObjectBaseFactory.Create <ITransportBuilder>().WithName(sbmlReaction.getId()); passiveTransport.ForAll = false; if (molInfoReactant.GetMoleculeBuilderName() == null) { return; } passiveTransport.MoleculeList.AddMoleculeName(molInfoReactant.GetMoleculeBuilderName()); var reactantCompartment = GetContainerFromCompartment_(molInfoReactant.GetCompartment(reactantSpecies)); var productCompartment = GetContainerFromCompartment_(molInfoProduct.GetCompartment(productSpecies)); if (reactantCompartment != null && productCompartment != null) { var reactantMatchTag = new MatchTagCondition(reactantCompartment.Name); var productMatchTag = new MatchTagCondition(productCompartment.Name); passiveTransport.SourceCriteria.Add(reactantMatchTag); passiveTransport.TargetCriteria.Add(productMatchTag); } var parameters = CreateLocalParameters(sbmlReaction); if (parameters != null) { parameters.ForEach(passiveTransport.AddParameter); } CreateKinetic(sbmlReaction, passiveTransport); AddNeighbourhood(reactantCompartment, productCompartment, model); _passiveTransportBuildingBlock.Add(passiveTransport); }