示例#1
0
        public void DecodePolyLineWhenEncdodedLocationsIsNullTest()
        {
            var exception = Assert.Throws <ArgumentNullException>(() =>
            {
                var decodePolyLine = GoogleFunctions.DecodePolyLine(null);
                Assert.IsNull(decodePolyLine);
            });

            Assert.AreEqual("encodedLocations", exception.ParamName);
        }
示例#2
0
        public void DecodePolyLineTest()
        {
            var decodePolyLine = GoogleFunctions.DecodePolyLine(GoogleFunctionsTest.POLY_LINE).ToArray();

            Assert.IsNotNull(decodePolyLine.FirstOrDefault());
            Assert.AreEqual(3, decodePolyLine.Length);
            Assert.AreEqual(decodePolyLine[0].LocationString, location1.LocationString);
            Assert.AreEqual(decodePolyLine[1].LocationString, location2.LocationString);
            Assert.AreEqual(decodePolyLine[2].LocationString, location3.LocationString);
        }
示例#3
0
 private IEnumerable <Location> DecodePoints()
 {
     try
     {
         return(GoogleFunctions.DecodePolyLine(this.EncodedPoints));
     }
     catch (Exception _ex)
     {
         throw new PointsDecodingException("Couldn't decode points", this.EncodedPoints, _ex);
     }
 }
示例#4
0
        public void MergePolyLineTest()
        {
            var mergePolyLine = GoogleFunctions.MergePolyLine(GoogleFunctionsTest.POLY_LINE, GoogleFunctionsTest.POLY_LINE_2);

            Assert.IsNotNull(mergePolyLine);
            Assert.AreEqual("chdEchdEoxgFoxgFi`vEi`vEe~|g@e~|g@ore}@ore}@izs|@izs|@", mergePolyLine);

            var decodePolyLine = GoogleFunctions.DecodePolyLine(mergePolyLine).ToArray();

            Assert.IsNotNull(decodePolyLine.FirstOrDefault());
            Assert.AreEqual(6, decodePolyLine.Length);
            Assert.AreEqual(decodePolyLine[0].LocationString, location1.LocationString);
            Assert.AreEqual(decodePolyLine[1].LocationString, location2.LocationString);
            Assert.AreEqual(decodePolyLine[2].LocationString, location3.LocationString);
            Assert.AreEqual(decodePolyLine[3].LocationString, location4.LocationString);
            Assert.AreEqual(decodePolyLine[4].LocationString, location5.LocationString);
            Assert.AreEqual(decodePolyLine[5].LocationString, location6.LocationString);
        }
示例#5
0
 private IEnumerable <Location> DecodePoints()
 {
     return(GoogleFunctions.DecodePolyLine(this.EncodedPoints));
 }