Esempio n. 1
0
        public async Task Can_CalculateDistanceBetweenGeoMembers()
        {
            await redis.FlushDbAsync();

            await redis.AddGeoMembersAsync("Sicily", new[] {
                new RedisGeo(13.361389, 38.115556, "Palermo"),
                new RedisGeo(15.087269, 37.502669, "Catania")
            });

            var distance = await redis.CalculateDistanceBetweenGeoMembersAsync("Sicily", "Palermo", "Catania");

            Assert.That(distance, Is.EqualTo(166274.15156960039).Within(.1));
        }