示例#1
0
        public void GeocodingWhenAddressAndLocationIsNullTest()
        {
            var request   = new GeocodingRequest();
            var exception = Assert.Throws <ArgumentException>(() =>
            {
                var parameters = request.GetQueryStringParameters();
                Assert.IsNull(parameters);
            });

            Assert.IsNotNull(exception);
            Assert.AreEqual(exception.Message, "Location, PlaceId or Address is required");
        }
示例#2
0
        public void GeocodingWhenPlaceIdAndKeyIsNullTest()
        {
            var request = new GeocodingRequest {
                PlaceId = "test"
            };
            var exception = Assert.Throws <ArgumentException>(() =>
            {
                var parameters = request.GetQueryStringParameters();
                Assert.IsNull(parameters);
            });

            Assert.IsNotNull(exception);
            Assert.AreEqual(exception.Message, "Key is required, when using PlaceId");
        }