private static DnsSpamLookupResult FromStore(string tenant, string ipAddress) { var lookupServers = GetRblServers(tenant); var reverser = new IpAddressReverser(); var resolver = new HostEntryResolver(); var queryable = new DnsQueryable(resolver); var lookup = new DnsSpamLookup(reverser, queryable, lookupServers); return lookup.IsListedInSpamDatabase(ipAddress); }
private static DnsSpamLookupResult FromStore(string tenant, string ipAddress) { var lookupServers = GetRblServers(tenant); var reverser = new IpAddressReverser(); var resolver = new HostEntryResolver(); var queryable = new DnsQueryable(resolver); var lookup = new DnsSpamLookup(reverser, queryable, lookupServers); return(lookup.IsListedInSpamDatabase(ipAddress)); }
public void IsListedInSpamDatabaseTest(string ipAddress, bool isSpammer) { var lookupServers = new []{""}; var reverser = new IpAddressReverser(); var resolver = new FakeHostEntryResolver(); var queryable = new DnsQueryable(resolver); var lookup = new DnsSpamLookup(reverser, queryable, lookupServers); var result = lookup.IsListedInSpamDatabase(ipAddress); Assert.Equal(isSpammer, result.IsListed); }
public void IsListedInSpamDatabaseTest(string ipAddress, bool isSpammer) { var lookupServers = new [] { "" }; var reverser = new IpAddressReverser(); var resolver = new FakeHostEntryResolver(); var queryable = new DnsQueryable(resolver); var lookup = new DnsSpamLookup(reverser, queryable, lookupServers); var result = lookup.IsListedInSpamDatabase(ipAddress); Assert.Equal(isSpammer, result.IsListed); }