Ejemplo n.º 1
0
        public void MapsApi_Load_Settings_Empty()
        {
            var context = MapsApiContext.Load(new NameValueCollection());

            Assert.IsNotNull(context);
            Assert.IsNull(context.ApiKey);
            Assert.AreEqual(MapsApiContext.DefaultAutoRetry, context.AutoRetry);
            Assert.AreEqual(MapsApiContext.DefaultGeocodeApiUrl, context.GeocodeApiUrl);
            Assert.AreEqual(MapsApiContext.DefaultRetryDelay, context.RetryDelay);
            Assert.AreEqual(MapsApiContext.DefaultRetryTimes, context.RetryTimes);
        }
Ejemplo n.º 2
0
        public void MapsApi_Load_Settings_RetryDelay()
        {
            var expected = 300;
            var settings = new NameValueCollection();

            settings.Add("GoogleMaps.RetryDelay", expected.ToString());

            var context = MapsApiContext.Load(settings);

            Assert.IsNotNull(context);
            Assert.IsNull(context.ApiKey);
            Assert.AreEqual(MapsApiContext.DefaultAutoRetry, context.AutoRetry);
            Assert.AreEqual(MapsApiContext.DefaultGeocodeApiUrl, context.GeocodeApiUrl);
            Assert.AreEqual(expected, context.RetryDelay);
            Assert.AreEqual(MapsApiContext.DefaultRetryTimes, context.RetryTimes);
        }
Ejemplo n.º 3
0
 public void MapsApi_Load_Settings_Null()
 {
     Assert.Throws <ArgumentNullException>(() => MapsApiContext.Load(null));
 }