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); }
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); }
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); }