public void Socket_ReceiveFromDnsEndPoint_Throws()
{
// "The parameter remoteEP must not be of type DnsEndPoint."
using (Socket socket = new Socket(SocketType.Dgram, ProtocolType.Udp))
{
int port = socket.BindToAnonymousPort(IPAddress.IPv6Loopback);
EndPoint receivedFrom = new DnsEndPoint("localhost", port, AddressFamily.InterNetworkV6);
Assert.Throws<ArgumentException>(() =>
{
int received = socket.ReceiveFrom(new byte[1], ref receivedFrom);
});
}
}