示例#1
0
        public async Task Can_Delete_All_Items()
        {
            var cachedRecord = new CacheRecord
            {
                Id       = "key",
                Children =
                {
                    new CacheRecordChild {
                        Id = "childKey", Data = "data"
                    }
                }
            };

            await RedisTyped.StoreAsync(cachedRecord);

            Assert.That(await RedisTyped.GetByIdAsync("key"), Is.Not.Null);

            await RedisTyped.DeleteAllAsync();

            Assert.That(await RedisTyped.GetByIdAsync("key"), Is.Null);
        }
        public async Task Can_DeleteAll()
        {
            var tos = Factory.CreateList();
            await redis.StoreAllAsync(tos);

            var all = await redis.GetAllAsync();

            Assert.That(all.Count, Is.EqualTo(tos.Count));

            await redis.DeleteAllAsync();

            all = await redis.GetAllAsync();

            Assert.That(all.Count, Is.EqualTo(0));
        }