コード例 #1
0
        public void RemoveSplitsTest()
        {
            //Arrange
            var splitName        = "test_split";
            var redisAdapterMock = new Mock <IRedisAdapter>();

            redisAdapterMock.Setup(x => x.Del(It.IsAny <RedisKey[]>())).Returns(1);
            string value = null;

            redisAdapterMock.Setup(x => x.Get(splitKeyPrefix + "test_split")).Returns(value);
            var splitCache = new RedisSplitCache(redisAdapterMock.Object);

            //Act
            var removedCount = splitCache.RemoveSplits(new List <string>()
            {
                splitName
            });
            var result = splitCache.GetSplit(splitName);

            //Assert
            Assert.AreEqual(1, removedCount);
            Assert.IsNull(result);
        }