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

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

            Assert.That(count, Is.EqualTo(2));

            var results = await redis.GetGeoCoordinatesAsync("Sicily", new[] { "Palermo", "Catania" });

            Assert.That(results.Count, Is.EqualTo(2));
            Assert.That(results[0].Longitude, Is.EqualTo(13.361389).Within(.1));
            Assert.That(results[0].Latitude, Is.EqualTo(38.115556).Within(.1));
            Assert.That(results[0].Member, Is.EqualTo("Palermo"));

            Assert.That(results[1].Longitude, Is.EqualTo(15.087269).Within(.1));
            Assert.That(results[1].Latitude, Is.EqualTo(37.502669).Within(.1));
            Assert.That(results[1].Member, Is.EqualTo("Catania"));
        }