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)); }
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); }