コード例 #1
0
ファイル: DnsSpamLookupHelper.cs プロジェクト: frapid/frapid
        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);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
ファイル: DnsSpamLookupTests.cs プロジェクト: frapid/frapid
        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);
        }
コード例 #4
0
        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);
        }