Beispiel #1
0
        public async Task NotAllowed()
        {
            var policy = new BlackList <string>();

            policy.Add("c");
            policy.Add("d");
            Assert.IsFalse(await policy.IsNotAllowedAsync("a"));
            Assert.IsFalse(await policy.IsNotAllowedAsync("b"));
            Assert.IsTrue(await policy.IsNotAllowedAsync("c"));
            Assert.IsTrue(await policy.IsNotAllowedAsync("d"));
        }
Beispiel #2
0
        public void Allowed()
        {
            var policy = new BlackList <string>();

            policy.Add("c");
            policy.Add("d");
            Assert.IsTrue(policy.IsAllowed("a"));
            Assert.IsTrue(policy.IsAllowed("b"));
            Assert.IsFalse(policy.IsAllowed("c"));
            Assert.IsFalse(policy.IsAllowed("d"));
        }