public void SimplifyEmptyLine_AlreadySimplified_ShouldReturnIt()
        {
            var line = new LineString(new[]
            {
                new Coordinate(0, 0),
                new Coordinate(100, 0)
            });

            var simplified = RadialDistanceByAngleSimplifier.Simplify(line, 30, 90);

            Assert.AreEqual(simplified.Count, line.Count);
        }
        public void SimplifyEmptyLine_VeryShort_ShouldReturnNull()
        {
            var line = new LineString(new[]
            {
                new Coordinate(0, 0),
                new Coordinate(10, 0)
            });

            var simplified = RadialDistanceByAngleSimplifier.Simplify(line, 30, 90);

            Assert.IsNull(simplified);
        }
        public void SimplifyLine_ShouldNotSimplifyByAngleDueToDistance_ShouldReturnSimplifiedLine()
        {
            var line = new LineString(new[]
            {
                new Coordinate(0, 0),
                new Coordinate(100, 0),
                new Coordinate(0, 1),
                new Coordinate(100, 1)
            });

            var simplified = RadialDistanceByAngleSimplifier.Simplify(line, 30, 90);

            Assert.AreEqual(line.Coordinates.Length, simplified.Coordinates.Length);
        }
        public void SimplifyLine_NoSimplificationNeeded_ShouldReturnSameLine()
        {
            var line = new LineString(new[]
            {
                new Coordinate(0, 0),
                new Coordinate(100, 0),
                new Coordinate(200, 0),
                new Coordinate(300, 0),
            });

            var simplified = RadialDistanceByAngleSimplifier.Simplify(line, 30, 90);

            Assert.AreEqual(line.Coordinates.Length, simplified.Coordinates.Length);
        }
        public void SimplifyLine_ZigZag_ShouldReturnRemoveIt()
        {
            var coordinateThatShouldBeRemoved = new Coordinate(1, 0);
            var line = new LineString(new[]
            {
                new Coordinate(0, 0),
                new Coordinate(10, 0),
                coordinateThatShouldBeRemoved,
                new Coordinate(11, 0),
                new Coordinate(0, 0)
            });

            var simplified = RadialDistanceByAngleSimplifier.Simplify(line, 30, 90);

            Assert.IsFalse(simplified.Coordinates.Contains(coordinateThatShouldBeRemoved));
        }
        public void SimplifyEmptyLine_ShouldReturnNull()
        {
            var simplified = RadialDistanceByAngleSimplifier.Simplify(new LineString(new Coordinate[0]), 0, 0);

            Assert.IsNull(simplified);
        }