コード例 #1
0
        public async Task FlushTest()
        {
            using (MemcachedClient client = GetClient())
            {
                for (int i = 0; i < 10; i++)
                {
                    string cacheKey = $"Hello_Flush_{i}";
                    Assert.True(await client.StoreAsync(StoreMode.Set, cacheKey, i, DateTime.Now.AddSeconds(30)));
                }

                await client.FlushAllAsync();

                for (int i = 0; i < 10; i++)
                {
                    string cacheKey = $"Hello_Flush_{i}";
                    Assert.Null(await client.GetValueAsync <string>(cacheKey));
                }
            }
        }