Example #1
0
        public void TestCalculateGeoHash()
        {
            GDate  gdate = new GDate(2005, 05, 26);
            string djia  = "10458.68";

            string expected_fraction0 = "857713";
            string expected_fraction1 = "544543";

            var fractions  = GeoHash.CalculateFractions(djia, gdate);
            var sfraction0 = fractions[0].ToString().Substring(2, 6);
            var sfraction1 = fractions[1].ToString().Substring(2, 6);

            Assert.AreEqual(expected_fraction0, sfraction0);
            Assert.AreEqual(expected_fraction1, sfraction1);
        }