public async Task RemoveQueue()
        {
            using (TCacheService cache = new TCacheService(TestConfiguration.EnvRedisUri))
            {
                await cache.RemoveKey(TestQueueName);

                bool exists = await cache.QueueExists(TestQueueName);

                Assert.False(exists);
            }
        }
        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));
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        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);
            }
        }
Esempio n. 5
0
 public async Task <bool> QueueExists(string queueName)
 {
     return(await _cacheService.QueueExists(queueName));
 }