Exemple #1
0
        public async Task Allowed()
        {
            var policy = new WhiteList <string>();

            policy.Add("a");
            policy.Add("b");
            Assert.IsTrue(await policy.IsAllowedAsync("a"));
            Assert.IsTrue(await policy.IsAllowedAsync("b"));
            Assert.IsFalse(await policy.IsAllowedAsync("c"));
            Assert.IsFalse(await policy.IsAllowedAsync("d"));
        }
Exemple #2
0
        public async Task Empty()
        {
            var policy = new WhiteList <string>();

            Assert.IsTrue(await policy.IsAllowedAsync("a"));
            Assert.IsFalse(await policy.IsNotAllowedAsync("a"));
        }