Пример #1
0
        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);
        }
Пример #2
0
        public override void Setup()
        {
            base.Setup();

            osmObjectMother = new OsmObjectMother();

            this.testDataProvider = MockRepository.GenerateMock <IOsmDatabaseProvider> ();
            testDataProvider.Expect(p => p.IsReloadable).Return(true).Repeat.Any();
            testDataProvider.Expect(p => p.Provide()).Return((InMemoryOsmDatabase)osmObjectMother.OsmDatabase)
            .Repeat.Any();

            polishMapFileCreator = MockRepository.GenerateStub <IPolishMapFileCreator> ();

            this.settings = new MapMakerSettings();

            this.runner = MockRepository.GenerateStub <ITaskRunner> ();
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }