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))); } }
public async Task IpParseCount_ReturnsCorrectValue(string address, int count) => Assert.AreEqual(count, (await IPParser.Parse(address)).Count());
public async Task IpParseNotEmpty_ReturnsCorrectValue(string address) => CollectionAssert.IsNotEmpty(await IPParser.Parse(address));