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)); }
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); } }
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); } }
public async Task <bool> QueueExists(string queueName) { return(await _cacheService.QueueExists(queueName)); }