Ejemplo n.º 1
0
        public void ConvertFromString_WithIPv6AndDefaultPortAndExplicitPortSpecified_ParsesIPEndPointWithExplicitPort()
        {
            var          expected  = new IPEndPoint(IPAddress.Parse("[1fbf:0:a88:85a3::ac1f]"), 8000);
            const string input     = "[1fbf:0:a88:85a3::ac1f]:8000";
            var          converter = new ConverterWithDefaultPort();

            var actual = converter.ConvertFromString(input);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void ConvertFromString_WithDefaultPortAndPortMissing_ParsesIPEndPointWithDefaultPort()
        {
            var          expected  = new IPEndPoint(IPAddress.Parse("192.168.1.1"), 8080);
            const string input     = "192.168.1.1";
            var          converter = new ConverterWithDefaultPort();

            var actual = converter.ConvertFromString(input);

            Assert.AreEqual(expected, actual);
        }