示例#1
0
        [TestCase(57.633573, 11.909510, 7890733, 1325761, 0)]            // Välen, Göteborg
        public void ToWebMercator_FromWgs84(double lat, double lng, double expectedLat, double expectedLng, int decimals)
        {
            var pos       = new WGS84Position(lat, lng);
            var converted = PositionConverter.ToWebMercator(pos);

            Assert.AreEqual(Math.Round(expectedLat, decimals, MidpointRounding.AwayFromZero), Math.Round(converted.Latitude, decimals, MidpointRounding.AwayFromZero));
            Assert.AreEqual(Math.Round(expectedLng, decimals, MidpointRounding.AwayFromZero), Math.Round(converted.Longitude, decimals, MidpointRounding.AwayFromZero));
        }