public static TryParse ( string addressWithPort, |
||
addressWithPort | string | |
endpoint | ||
리턴 | bool |
public void ShouldNotParse(string input) { IPEndPoint endpoint; var success = IPEndPointParser.TryParse(input, out endpoint); Assert.False(success); Assert.Null(endpoint); }
public void ParsesCorrectly(string input, string expectedAddress, int expectedPort) { IPEndPoint endpoint; var success = IPEndPointParser.TryParse(input, out endpoint); Assert.True(success); Assert.Equal(expectedAddress, endpoint.Address.ToString()); Assert.Equal(expectedPort, endpoint.Port); }