Exemple #1
0
        public void Can_GeoHash()
        {
            redis.FlushDb();
            redis.GeoAdd("Sicily",
                         new RedisGeo(13.361389, 38.115556, "Palermo"),
                         new RedisGeo(15.087269, 37.502669, "Catania"));

            var hashes = redis.GeoHash("Sicily", "Palermo", "Catania");

            Assert.That(hashes[0], Is.EqualTo("sqc8b49rny0"));
            Assert.That(hashes[1], Is.EqualTo("sqdtr74hyu0"));

            hashes = redis.GeoHash("Sicily", "Palermo", "NonExistingMember", "Catania");
            Assert.That(hashes[0], Is.EqualTo("sqc8b49rny0"));
            Assert.That(hashes[1], Is.Null);
            Assert.That(hashes[2], Is.EqualTo("sqdtr74hyu0"));
        }