public static void FromDNS() { var endpoint = new DnsEndPoint("localhost", 3262); var id = ClusterMemberId.FromEndPoint(endpoint).ToString(); True(ClusterMemberId.TryParse(id, out var actual)); Equal(ClusterMemberId.FromEndPoint(endpoint), actual); }
public static void FromUDS() { var endpoint = new UnixDomainSocketEndPoint("/path"); var id = ClusterMemberId.FromEndPoint(endpoint).ToString(); True(ClusterMemberId.TryParse(id, out var actual)); Equal(ClusterMemberId.FromEndPoint(endpoint), actual); }
public static void FromIP() { var endpoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 3262); var id = ClusterMemberId.FromEndPoint(endpoint).ToString(); True(ClusterMemberId.TryParse(id, out var actual)); Equal(ClusterMemberId.FromEndPoint(endpoint), actual); }
public static void Parsing() { var expected = new Random().Next <ClusterMemberId>(); True(ClusterMemberId.TryParse(expected.ToString().AsSpan(), out var actual)); Equal(expected, actual); var invalidHex = "AB142244"; False(ClusterMemberId.TryParse(invalidHex.AsSpan(), out _)); }