public void RoadTypeIsAccessibleReverseAppliesDefaultOnewayValueFromRoadType() { RoadType roadType = new RoadType(); roadType.Oneway = true; OSMWay oneWay = new OSMWay(0); OSMRoad target = new OSMRoad(oneWay, roadType); Assert.Equal(true, target.IsAccessible()); Assert.Equal(false, target.IsAccessibleReverse()); }
public void RoadTypeIsAccessibleReverseAppliesOnewayTagOverridesDefaultValueForRoadType2() { RoadType roadType = new RoadType(); roadType.Oneway = false; OSMWay way = new OSMWay(0); way.Tags.Add(new OSMTag("oneway", "yes")); OSMRoad target = new OSMRoad(way, roadType); Assert.Equal(true, target.IsAccessible()); Assert.Equal(false, target.IsAccessibleReverse()); }
public void RoadTypeIsAccessibleAndIsAccessibleReturnsCorrectValuesForReverseOnewayRoads() { RoadType roadType = new RoadType(); roadType.RequiredTags.Add(new OSMTag("highway", "*")); OSMWay oneWay1 = new OSMWay(0); oneWay1.Tags.Add(new OSMTag("oneway", "-1")); OSMRoad target1 = new OSMRoad(oneWay1, roadType); OSMWay oneWay2 = new OSMWay(0); oneWay2.Tags.Add(new OSMTag("oneway", "reverse")); OSMRoad target2 = new OSMRoad(oneWay2, roadType); Assert.False(target1.IsAccessible()); Assert.True(target1.IsAccessibleReverse()); Assert.False(target2.IsAccessible()); Assert.True(target2.IsAccessibleReverse()); }