public void BuildLabelWithRelationTagsAndConditionals() { const string expression = @"relation:name ""blabla"""; LabelExpressionParser parser = new LabelExpressionParser(); LabelExpression parsedExpression = parser.Parse(expression, 0); OsmObjectMother mother = new OsmObjectMother(); mother .AddRelation(); MapMakerSettings mapMakerSettings = new MapMakerSettings(); string label = parsedExpression.BuildLabel(mapMakerSettings, mother.CurrentObject, mother.CurrentRelation); Assert.AreEqual(String.Empty, label); }
public void BuildVariousLabels(string labelExpression, string expectedLabel) { LabelExpressionParser parser = new LabelExpressionParser(); LabelExpression parsedExpression = parser.Parse(labelExpression, 0); OsmObjectMother mother = new OsmObjectMother(); mother .AddRelation() .Tag("name", "Relation") .AddWay(5) .Tag("name", "Way") .AddToRelation("friend"); MapMakerSettings mapMakerSettings = new MapMakerSettings(); string label = parsedExpression.BuildLabel(mapMakerSettings, mother.CurrentObject, mother.CurrentRelation); Assert.AreEqual(expectedLabel, label); }
public void BuildLabelWithRelationTags() { const string expression = @"relation:name ++ name"; LabelExpressionParser parser = new LabelExpressionParser(); LabelExpression parsedExpression = parser.Parse(expression, 0); OsmObjectMother mother = new OsmObjectMother(); mother .AddRelation() .Tag("name", "My name is Relation") .AddWay(5) .Tag("name", "My name is Way") .AddToRelation("friend"); MapMakerSettings mapMakerSettings = new MapMakerSettings(); string label = parsedExpression.BuildLabel(mapMakerSettings, mother.CurrentObject, mother.CurrentRelation); Assert.AreEqual("My name is RelationMy name is Way", label); }