コード例 #1
0
        public void TestParseUserList()
        {
            // Test some random addresses grabbed from the channel.
            var userList = new[] { "x201500200", "u4stwEBjT6FYyVV", "u5BKEqDApa8SbA7" };

            var addresses = IrcDiscovery.ParseUserList(userList);

            // Make sure the "x" address is excluded.
            Assert.AreEqual(2, addresses.Count, "Too many addresses.");

            var ips = new[] { "69.4.98.82:8333", "74.92.222.129:8333" };

            for (var i = 0; i < addresses.Count; i++)
            {
                Assert.AreEqual(ips[i], addresses[i].ToString(), "IPs decoded improperly");
            }
        }
コード例 #2
0
        public void TestParseUserList()
        {
            // Test some random addresses grabbed from the channel.
            var userList = new[] { "x201500200", "u4stwEBjT6FYyVV", "u5BKEqDApa8SbA7" };

            var addresses = IrcDiscovery.ParseUserList(userList);

            // Make sure the "x" address is excluded.
            Assert.AreEqual(2, addresses.Count, "Too many addresses.");

            var ips     = new[] { "69.4.98.82:8333", "74.92.222.129:8333" };
            var decoded = addresses.ToArray();

            for (var i = 0; i < decoded.Length; i++)
            {
                var formattedIp = decoded[0].Address + ":" + decoded[i].Port;
                Assert.AreEqual(ips[0], formattedIp, "IPs decoded improperly");
            }
        }