Esempio n. 1
0
        public void Test_AllwaysReturnsFalse_KeyNullOrEmpty(string testKey)
        {
            Mock <ICacheClient> cacheClientMocker =
                new Mock <ICacheClient>(MockBehavior.Loose);

            ICacheClient cacheClient = cacheClientMocker.Object;

            AlwaysFalseCacheClientRule rule =
                new AlwaysFalseCacheClientRule(cacheClient);

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

            ICacheClient cacheClient = cacheClientMocker.Object;

            AlwaysFalseCacheClientRule rule =
                new AlwaysFalseCacheClientRule(cacheClient);

            Assert.IsFalse(rule.Matches(testKey));
            Assert.AreSame(cacheClient, rule.Client);
        }