Пример #1
0
        public void TestEdgeMatcher()
        {
            IEdgeMatcher matcher = new DefaultEdgeMatcher();

            // create edge tags.
            var edgeTags = new SimpleTagsCollection();
            //edge_tags["highway"] = "footway";

            // create point tags.
            var pointTags = new SimpleTagsCollection();
            //point_tags["highway"] = "footway";

            // test with empty point tags.
            Assert.IsTrue(matcher.MatchWithEdge(Vehicle.Car, null, null));
            Assert.IsTrue(matcher.MatchWithEdge(Vehicle.Car, pointTags, null));

            // test with empty edge tags.
            pointTags["name"] = "Ben Abelshausen Boulevard";
            Assert.IsFalse(matcher.MatchWithEdge(Vehicle.Car, pointTags, null));
            Assert.IsFalse(matcher.MatchWithEdge(Vehicle.Car, pointTags, edgeTags));

            // test with matching name.
            edgeTags["name"] = "Ben Abelshausen Boulevard";
            Assert.IsTrue(matcher.MatchWithEdge(Vehicle.Car, pointTags, edgeTags));

            // test with none-matching name.
            edgeTags["name"] = "Jorieke Vyncke Boulevard";
            Assert.IsFalse(matcher.MatchWithEdge(Vehicle.Car, pointTags, edgeTags));
        }