示例#1
0
        public void ConvertFromString_WithCorrectValue_ParsesIPEndPoint()
        {
            var          expected  = new IPEndPoint(IPAddress.Parse("192.168.1.1"), 8000);
            const string input     = "192.168.1.1:8000";
            var          converter = new IPHostConverter();

            var actual = converter.ConvertFromString(input);

            Assert.AreEqual(expected, actual);
        }
示例#2
0
        public void ConvertFromString_WithIPv6AddressAndNoBrackets_ParsesIPEndPoint()
        {
            var          expected  = new IPEndPoint(IPAddress.Parse("[1fbf:0:a88:85a3::ac1f]"), 8000);
            const string input     = "[1fbf:0:a88:85a3::ac1f]:8000";
            var          converter = new IPHostConverter();

            var actual = converter.ConvertFromString(input);

            Assert.AreEqual(expected, actual);
        }
示例#3
0
        public void ConvertFromString_WithDomainName_ParsesIPEndPointIPv6()
        {
            var          expected  = new IPEndPoint(IPAddress.Parse("[::1]"), 8000);
            const string input     = "localhost:8000";
            var          converter = new IPHostConverter();

            var actual = converter.ConvertFromString(input);

            Assert.AreEqual(expected, actual);
        }