コード例 #1
0
        public async Task Can_FindGeoMembersInRadius()
        {
            await redis.FlushDbAsync();

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

            var results = await redis.FindGeoMembersInRadiusAsync("Sicily", 15, 37, 200, RedisGeoUnit.Kilometers);

            Assert.That(results.Length, Is.EqualTo(2));
            Assert.That(results[0], Is.EqualTo("Palermo"));
            Assert.That(results[1], Is.EqualTo("Catania"));
        }