public void Polyliner_Decode_ShouldNotThrowException(string polyline)
        {
            // arrange
            var polyliner = new Polyliner();

            // act
            var result = polyliner.Decode(polyline);

            // assert
            Assert.NotNull(result);
        }
        [InlineData(@"xuekEl|inL", -33.45773, -70.67095)]    // Sandiego
        public void Polyliner_Decode_ShouldReturnArray_WithOnePositionElement(string polyline, double latitude, double longitude)
        {
            // arrange
            var polyliner = new Polyliner();

            // act
            var result = polyliner.Decode(polyline);

            // assert
            Assert.Equal(latitude, result[0].Latitude, 5);
            Assert.Equal(longitude, result[0].Longitude, 5);
        }
Ejemplo n.º 3
0
    static public List <Coordinate> PolylineRoad(string polyline)
    {
        var polyliner = new Polyliner();
        var result    = polyliner.Decode(polyline);

        List <Coordinate> test = new List <Coordinate>();

        for (int i = 0; i < result.Count; i++)
        {
            test.Add(ConvertorCoordinates.DegressToMeter(new Coordinate(result[i].Longitude, result[i].Latitude)));
        }

        return(test);
    }
        public void Polyliner_DecodeGoogleExamples_ShouldReturnArray_WithExpectedPositionsElement(string polyline)
        {
            // arrange
            var polyliner = new Polyliner();

            // act
            var result = polyliner.Decode(polyline);

            // assert
            Assert.Equal(3, result.Count);

            Assert.Equal(38.5, result[0].Latitude, 5);
            Assert.Equal(-120.2, result[0].Longitude, 5);

            Assert.Equal(40.7, result[1].Latitude, 5);
            Assert.Equal(-120.95, result[1].Longitude, 5);

            Assert.Equal(43.252, result[2].Latitude, 5);
            Assert.Equal(-126.453, result[2].Longitude, 5);
        }