Example #1
0
        public async Task Can_enumerate_small_IDictionary_Hash()
        {
            var mapValues = CreateMap();
            await mapValues.ForEachAsync(async (k, v) => await redis.SetEntryInHashAsync(Hash, k, v));

            var members = new List <string>();

            await foreach (var item in redis.GetHash <string>(HashId))
            {
                Assert.That(mapValues.ContainsKey(item.Key), Is.True);
                members.Add(item.Key);
            }
            Assert.That(members.Count, Is.EqualTo(mapValues.Count));
        }
Example #2
0
        public async Task SetUp()
        {
            if (client is object)
            {
                await client.DisposeAsync();

                client = null;
            }
            client = new RedisClient(TestConfig.SingleHost);
            await client.FlushAllAsync();

            redis = client.As <T>();

            Hash = redis.GetHash <string>(HashId);
        }