Exemplo n.º 1
0
        public void GetUriWhenLocationsTest()
        {
            var request = new ElevationRequest
            {
                Key       = "abc",
                Locations = new[] { new Location(40.7141289, -73.9614074) }
            };

            var uri = request.GetUri();

            Assert.IsNotNull(uri);
            Assert.AreEqual($"/maps/api/elevation/json?key={request.Key}&locations={Uri.EscapeDataString(string.Join("|", request.Locations))}", uri.PathAndQuery);
        }
Exemplo n.º 2
0
        public void GetUriWhenWhenPathAndSamplesTest()
        {
            var request = new ElevationRequest
            {
                Key     = "abc",
                Path    = new[] { new Location(40.7141289, -73.9614074) },
                Samples = 2
            };

            var uri = request.GetUri();

            Assert.IsNotNull(uri);
            Assert.AreEqual($"/maps/api/elevation/json?key={request.Key}&path={Uri.EscapeDataString(string.Join("|", request.Path))}&samples={request.Samples.ToString()}", uri.PathAndQuery);
        }