public void TestCollectionConcatenation() { Dictionary dictionary = CreateDictionary("Test"); NameSpace nameSpace = CreateNameSpace(dictionary, "NameSpace"); Structure structure = CreateStructure(nameSpace, "ModelElement"); StructureElement structElem = CreateStructureElement(structure, "Value", "Boolean"); structElem.setDefault("True"); Collection collection = CreateCollection(nameSpace, "Coll", "ModelElement", 10); collection.Type = structure; collection.setMaxSize(3); collection.Default = "[]"; Variable variable = CreateVariable(nameSpace, "V", "Coll"); RuleCondition ruleCondition = CreateRuleAndCondition(nameSpace, "Test"); Action action = CreateAction(ruleCondition, "V <- V + [ModelElement{Value => True}] "); RuleCheckerVisitor visitor = new RuleCheckerVisitor(dictionary); visitor.visit(nameSpace); Util.IsThereAnyError isThereAnyError = new Util.IsThereAnyError(); Assert.AreEqual(0, isThereAnyError.ErrorsFound.Count); Assert.AreEqual("[]", variable.Value.LiteralName); Runner runner = new Runner(false); runner.Cycle(); Assert.AreEqual("[" + structure.DefaultValue.LiteralName + "]", variable.Value.LiteralName); runner.Cycle(); Assert.AreEqual("[" + structure.DefaultValue.LiteralName + ", " + structure.DefaultValue.LiteralName + "]", variable.Value.LiteralName); runner.Cycle(); Assert.AreEqual("[" + structure.DefaultValue.LiteralName + ", " + structure.DefaultValue.LiteralName + ", " + structure.DefaultValue.LiteralName + "]", variable.Value.LiteralName); // In this case, the new collection cannot be placed in the variable runner.Cycle(); Assert.AreEqual(1, action.Messages.Count); Assert.AreEqual(ElementLog.LevelEnum.Error, action.Messages[0].Level); }