public async Task Allowed()
        {
            var policy = new BlackList <string>();

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

            Assert.IsTrue(await policy.IsAllowedAsync("a"));
            Assert.IsFalse(await policy.IsNotAllowedAsync("a"));
        }
示例#3
0
 /// <inheritdoc />
 public async Task <bool> IsAllowedAsync(MultiAddress target, CancellationToken cancel = default(CancellationToken))
 {
     return(await BlackList.IsAllowedAsync(target, cancel) &&
            await WhiteList.IsAllowedAsync(target, cancel));
 }