public void Socket_SendToDnsEndPoint_Throws() { Socket socket = new Socket(SocketType.Dgram, ProtocolType.Udp); Assert.Throws<ArgumentException>(() => { socket.SendTo(new byte[1], new DnsEndPoint("localhost", UnusedPort)); }); }