コード例 #1
0
        public async Task RemoveQueue()
        {
            using (TCacheService cache = new TCacheService(TestConfiguration.EnvRedisUri))
            {
                await cache.RemoveKey(TestQueueName);

                bool exists = await cache.QueueExists(TestQueueName);

                Assert.False(exists);
            }
        }
コード例 #2
0
        public async Task CreateQueue()
        {
            TCacheService cache = new TCacheService(TestConfiguration.EnvRedisUri);

            await cache.PushToQueue(TestQueueName, new List <Cat> {
                new Cat {
                    Name = "Ted", Age = 3
                }
            });

            Assert.True(await cache.QueueExists(TestQueueName));
        }
コード例 #3
0
ファイル: TCacheGetTests.cs プロジェクト: greenygh0st/tcache
        public async Task TestRemoveExistingQueue()
        {
            using (TCacheService cache = new TCacheService(TestConfiguration.EnvRedisUri))
            {
                await cache.PushToQueue(TestRemoveQueue, new List <Cat> {
                    new Cat {
                        Name = "Kel", Age = 12
                    }
                });

                await cache.RemoveQueue(TestRemoveQueue);

                bool result = await cache.QueueExists(TestRemoveQueue);

                Assert.False(result);
            }
        }
コード例 #4
0
ファイル: TCacheGetTests.cs プロジェクト: greenygh0st/tcache
        public async Task BasicGetQueue()
        {
            // NOTE: This test is both to test the basic string fetch functionality and it tests to see if an empty LIST key properly unsets
            using (TCacheService cache = new TCacheService())
            {
                await cache.PushToQueue(TestQueueNameSecond, new List <Cat> {
                    new Cat {
                        Name = "Amolee"
                    }
                });

                string result = await cache.PopFromQueue(TestQueueNameSecond);

                bool resultCheck = result.Contains("Amolee");
                bool queueExists = await cache.QueueExists(TestQueueNameSecond);

                Assert.True(resultCheck && !queueExists);
            }
        }
コード例 #5
0
ファイル: QueueService.cs プロジェクト: greenygh0st/icache
 public async Task <bool> QueueExists(string queueName)
 {
     return(await _cacheService.QueueExists(queueName));
 }