예제 #1
0
        public void GetLocation()
        {
            //arrange
            ILocationSupplier supplier = new GeoIpLocationSupplier("Db\\GeoLite2-City.mmdb");
            //act
            string  response = supplier.GetLocationJson("86.120.44.89"); //our external Ip my change
            dynamic Location = JObject.Parse(response);

            //assert

            Assert.AreEqual(Location.Location.Country.Name.ToString(), "Romania");
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ILocationSupplier supplier = new GeoIpLocationSupplier(HttpContext.Current.Server.MapPath("bin\\Db\\GeoLite2-City.mmdb"));

            LocationLiteral = supplier.GetLocationJson(Request.UserHostAddress);
        }