protected override void Context() { var entity = new Parameter(); entity.AddTag("Parameter"); entity.AddTag("Kidney"); var parentContainer = new Container().WithName("Liver"); parentContainer.AddTag("Organ"); parentContainer.Add(entity); var grandParentContainer = new Container { parentContainer }.WithName("Organism"); grandParentContainer.AddTag("DUDE"); _entityCriteria = new EntityDescriptor(entity); _match = new NotInContainerCondition("Kidney"); _doNotMatch = new NotInContainerCondition("Liver"); _alsoMatch = new NotInContainerCondition("HELLO"); }
protected override void Context() { var entity = new Parameter(); entity.AddTag("tag1"); entity.AddTag("tag2"); _match = new NotMatchTagCondition("tag1"); _doNotMatch = new NotMatchTagCondition("do not match"); _entityCriteria = new EntityDescriptor(entity); }
protected override void Context() { var entity = new Parameter(); entity.AddTag("tag1"); entity.AddTag("tag2"); _entityCriteria = new EntityDescriptor(entity); sut = new MatchAllCondition(); }
protected override void Context() { var organism = new Container().WithName("Organism"); _objectPathFactory = new ObjectPathFactory(new AliasCreator()); _fuParameter = new Parameter().WithName("fu").WithValue(0.5); organism.Add(_fuParameter); var liver = new Container().WithName("Liver").WithParentContainer(organism); var liverVolume = new Parameter().WithName("Volume").WithValue(10).WithParentContainer(liver); liverVolume.AddTag("Volume"); var f_vas_liver = new Parameter().WithName("f_vas").WithValue(0.1); liver.Add(f_vas_liver); var kidney = new Container().WithName("Kidney").WithParentContainer(organism); var kidneyVolume = new Parameter().WithName("Volume").WithValue(20).WithParentContainer(kidney); kidneyVolume.AddTag("Volume"); kidney.Add(new Parameter().WithName("f_vas").WithValue(0.2)); sut = new SumFormula(); sut.Criteria = Create.Criteria(x => x.With("Volume")); sut.Variable = "V"; sut.FormulaString = "fu * V_#i * f_vas_#i"; sut.AddObjectPath(_objectPathFactory.CreateRelativeFormulaUsablePath(liverVolume, f_vas_liver).WithAlias("f_vas_#i")); sut.AddObjectPath(_objectPathFactory.CreateAbsoluteFormulaUsablePath(_fuParameter).WithAlias("fu")); sut.Dimension = new Dimension(new BaseDimensionRepresentation(), "dim1", "unit1"); _allFormulaUsable = organism.GetAllChildren <IFormulaUsable>().ToList(); _objectBaseFactory = A.Fake <IObjectBaseFactory>(); A.CallTo(() => _objectBaseFactory.Create <ExplicitFormula>()).Returns(new ExplicitFormula()); }
private void addParentTagsTo(Parameter parameter) { var parentContainer = parameter?.ParentContainer; parentContainer?.Tags.Each(t => parameter.AddTag(t.Value)); }