Esempio n. 1
0
        public async Task Empty()
        {
            var policy = new WhiteList <string>();

            Assert.IsTrue(await policy.IsAllowedAsync("a"));
            Assert.IsFalse(await policy.IsNotAllowedAsync("a"));
        }
Esempio n. 2
0
        public async Task NotAllowed()
        {
            var policy = new WhiteList <string>();

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