public void GetKeysTestSuccessfully()
        {
            //Arrange
            _redisAdapterMock
            .Setup(x => x.Keys(splitKeyPrefix + "*"))
            .Returns(new RedisKey[] { "test_split", "test_split2" });

            //Act
            var result = _redisSplitCache.GetKeys();

            //Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(2, result.Count);
        }
Beispiel #2
0
        public void GetKeysShouldReturnEmptyResultIfNoKeysOrRedisException()
        {
            //Arrange
            var redisAdapterMock = new Mock <IRedisAdapter>();

            redisAdapterMock.Setup(x => x.Keys(splitKeyPrefix + "*")).Returns(new RedisKey[] { });
            var splitCache = new RedisSplitCache(redisAdapterMock.Object);

            //Act
            var result = splitCache.GetKeys();

            //Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(0, result.Count);
        }