Example #1
0
        public void CanGetOverlapForContinuousRangesAtDisjointEndpoints()
        {
            var ranges = new RouteMeasures(new[] { 0.001 }, new[] { 0.001 });

            var range1 = new CurveMeasureRange(1, 0, 0, 100.00001)
            {
                MMaxEndPoint = new Location(1000, 1000)
            };

            var range2 = new CurveMeasureRange(2, 0, 100, 200)
            {
                MMinEndPoint = new Location(1000, 2000)                              // disjoint
            };

            ranges.Add(_routeId, range1);
            ranges.Add(_routeId, range2);

            var overlaps = new List <OverlappingMeasures>(ranges.GetOverlaps());

            Assert.AreEqual(1, overlaps.Count);
        }
Example #2
0
        public void CanIgnoreContinuousRangesAtConnectedEndpoints()
        {
            var ranges = new RouteMeasures(new[] { 0.001 }, new[] { 0.001 });

            var range1 = new CurveMeasureRange(1, 0, 0, 100.00001)
            {
                MMaxEndPoint = new Location(1000, 1000)
            };

            var range2 = new CurveMeasureRange(2, 0, 100, 200)
            {
                MMinEndPoint = new Location(1000, 1000.0005)                              // within tolerance
            };

            ranges.Add(_routeId, range1);
            ranges.Add(_routeId, range2);

            var overlaps = new List <OverlappingMeasures>(ranges.GetOverlaps());

            Assert.AreEqual(0, overlaps.Count);
        }