public void Test_AllwaysReturnsTrue_KeyNullOrEmpty(string testKey)
        {
            Mock <ICacheClient> cacheClientMocker =
                new Mock <ICacheClient>(MockBehavior.Loose);

            ICacheClient cacheClient = cacheClientMocker.Object;

            AlwaysTrueCacheClientRule rule =
                new AlwaysTrueCacheClientRule(cacheClient);

            Assert.Throws <ArgumentNullException>(() => rule.Matches(testKey));
        }
        public void Test_AllwaysReturnsTrue_KeyNotEmpty(string testKey)
        {
            Mock <ICacheClient> cacheClientMocker =
                new Mock <ICacheClient>(MockBehavior.Loose);

            ICacheClient cacheClient = cacheClientMocker.Object;

            AlwaysTrueCacheClientRule rule =
                new AlwaysTrueCacheClientRule(cacheClient);

            Assert.IsTrue(rule.Matches(testKey));
            Assert.AreSame(cacheClient, rule.Client);
        }
        private List <IRoutedCacheClientRule> CreateTestRules(int numClients)
        {
            List <IRoutedCacheClientRule> rules =
                new List <IRoutedCacheClientRule>();

            for (int i = 0; i < numClients; i++)
            {
                Mock <ICacheClient> cacheClientMocker =
                    new Mock <ICacheClient>(MockBehavior.Loose);

                IRoutedCacheClientRule rule =
                    new AlwaysTrueCacheClientRule(cacheClientMocker.Object);
                rules.Add(rule);
            }

            return(rules);
        }