System.Net.Sockets.Tests.UdpClientTest.BeginSend_NegativeBytes_Throws C# (CSharp) Method

BeginSend_NegativeBytes_Throws() private method

private BeginSend_NegativeBytes_Throws ( ) : void
return void
        public void BeginSend_NegativeBytes_Throws()
        {
            UdpClient udpClient = new UdpClient(AddressFamily.InterNetwork);
            byte[] sendBytes = new byte[1];
            IPEndPoint remoteServer = new IPEndPoint(IPAddress.Loopback, UnusedPort);

            Assert.Throws<ArgumentOutOfRangeException>("bytes", () =>
            {
                udpClient.BeginSend(sendBytes, -1, remoteServer, new AsyncCallback(AsyncCompleted), udpClient);
            });
        }