Esempio n. 1
0
        public void ReverseTests(string ipAddress, string expected)
        {
            var reverser = new IpAddressReverser();

            string result = reverser.Reverse(ipAddress);

            Assert.Equal(expected, result);
        }
Esempio n. 2
0
        public IPHostEntry GetHostEntry(string address)
        {
            var    reverser = new IpAddressReverser();
            string server   = string.Empty;

            foreach (var ipAddress in this.Spammers)
            {
                string reversed = reverser.Reverse(ipAddress.ToString()) + "." + server;
                if (reversed.Equals(address))
                {
                    return(new IPHostEntry
                    {
                        AddressList = this.FakeRblServers.ToArray()
                    });
                }
            }

            return(new IPHostEntry());
        }