Ejemplo n.º 1
0
        public void RoadTypeMatchReturnsFalseForMissingTag()
        {
            RoadType target = new RoadType();
            target.RequiredTags.Add(new OSMTag("highway", "residental"));

            OSMWay testObject = new OSMWay(1);

            Assert.False(target.Match(testObject));
        }
Ejemplo n.º 2
0
        public void RoadTypeMatchReturnsFalseForMultipleTagsWithDifferentValues()
        {
            RoadType target = new RoadType();
            target.RequiredTags.Add(new OSMTag("highway", "track"));
            target.RequiredTags.Add(new OSMTag("grade", "1"));

            OSMWay testObject1 = new OSMWay(1);
            testObject1.Tags.Add(new OSMTag("highway", "primary"));
            target.RequiredTags.Add(new OSMTag("grade", "1"));

            OSMWay testObject2 = new OSMWay(1);
            testObject2.Tags.Add(new OSMTag("highway", "track"));
            target.RequiredTags.Add(new OSMTag("grade", "2"));

            OSMWay testObject3 = new OSMWay(1);
            testObject3.Tags.Add(new OSMTag("highway", "track"));

            Assert.False(target.Match(testObject1));
            Assert.False(target.Match(testObject2));
            Assert.False(target.Match(testObject3));
        }
Ejemplo n.º 3
0
        public void RoadTypeMatchReturnsTrueForTheSameMultipleTags()
        {
            RoadType target = new RoadType();
            target.RequiredTags.Add(new OSMTag("highway", "track"));
            target.RequiredTags.Add(new OSMTag("grade", "1"));

            OSMWay testObject = new OSMWay(1);
            testObject.Tags.Add(new OSMTag("grade", "1"));
            testObject.Tags.Add(new OSMTag("highway", "track"));

            Assert.True(target.Match(testObject));
        }
Ejemplo n.º 4
0
        public void RoadTypeMatchReturnsFalseForTagWithDifferentValue()
        {
            RoadType target = new RoadType();
            target.RequiredTags.Add(new OSMTag("highway", "residental"));

            OSMWay testObject = new OSMWay(1);
            testObject.Tags.Add(new OSMTag("highway", "primary"));

            Assert.False(target.Match(testObject));
        }
Ejemplo n.º 5
0
        public void RoadTypeMatchReturnsTrueForTheSameTags()
        {
            RoadType target = new RoadType();
            target.RequiredTags.Add(new OSMTag("highway", "residental"));

            OSMWay testObject = new OSMWay(1);
            testObject.Tags.Add(new OSMTag("highway", "residental"));

            Assert.True(target.Match(testObject));
        }