Example #1
0
        internal async Task AddToWhitelistAsync(IEnumerable <string> whitelist)
        {
            if (whitelist?.Any() != true)
            {
                return;
            }

            foreach (var address in whitelist)
            {
                var addressees = await IPParser.Parse(address).ConfigureAwait(false);

                _whitelist.AddRange(addressees.Where(x => !_whitelist.Contains(x)));
            }
        }
Example #2
0
 public async Task IpParseCount_ReturnsCorrectValue(string address, int count)
 => Assert.AreEqual(count, (await IPParser.Parse(address)).Count());
Example #3
0
 public async Task IpParseNotEmpty_ReturnsCorrectValue(string address)
 => CollectionAssert.IsNotEmpty(await IPParser.Parse(address));