Пример #1
0
        public void Redis_cache_empty_remove()
        {
            //Arrange
            var cache = new RedisStore(REDIS_LOCALHOST);

            //Act
            cache.Remove(string.Empty);

            //Assert
            Assert.NotNull(cache);
        }
Пример #2
0
        public void Redis_cache_with_value_set_remove_get()
        {
            //Arrange
            var          cache      = new RedisStore(REDIS_LOCALHOST);
            var          expiration = new TimeSpan(0, 1, 0);
            const string key        = "-Random-Key-4";

            var response = A.Fake <FakeCachedResponse>();

            //Act
            cache.Set(key, response, expiration);
            cache.Remove(key);
            bool found = cache.TryGetValue(key, out var getResponse);

            //Assert
            Assert.Null(getResponse);
            Assert.False(found);
        }