diff --git a/src/Microsoft.AspNet.WebSockets.Protocol/CommonWebSocket.cs b/src/Microsoft.AspNet.WebSockets.Protocol/CommonWebSocket.cs index ea74b29133..02a040af77 100644 --- a/src/Microsoft.AspNet.WebSockets.Protocol/CommonWebSocket.cs +++ b/src/Microsoft.AspNet.WebSockets.Protocol/CommonWebSocket.cs @@ -117,7 +117,7 @@ namespace Microsoft.AspNet.WebSockets.Protocol if (messageType != WebSocketMessageType.Binary && messageType != WebSocketMessageType.Text) { // Block control frames - throw new ArgumentOutOfRangeException("messageType", messageType, string.Empty); + throw new ArgumentOutOfRangeException(nameof(messageType), messageType, string.Empty); } // Check concurrent writes, pings & pongs, or closes @@ -588,15 +588,15 @@ namespace Microsoft.AspNet.WebSockets.Protocol { if (buffer.Array == null) { - throw new ArgumentNullException("buffer"); + throw new ArgumentNullException(nameof(buffer)); } if (buffer.Offset < 0 || buffer.Offset > buffer.Array.Length) { - throw new ArgumentOutOfRangeException("buffer.Offset", buffer.Offset, string.Empty); + throw new ArgumentOutOfRangeException(nameof(buffer.Offset), buffer.Offset, string.Empty); } if (buffer.Count < 0 || buffer.Count > buffer.Array.Length - buffer.Offset) { - throw new ArgumentOutOfRangeException("buffer.Count", buffer.Count, string.Empty); + throw new ArgumentOutOfRangeException(nameof(buffer.Count), buffer.Count, string.Empty); } } diff --git a/test/Microsoft.AspNet.WebSockets.Protocol.Test/BufferStream.cs b/test/Microsoft.AspNet.WebSockets.Protocol.Test/BufferStream.cs index 556bb42052..ca1c1c969f 100644 --- a/test/Microsoft.AspNet.WebSockets.Protocol.Test/BufferStream.cs +++ b/test/Microsoft.AspNet.WebSockets.Protocol.Test/BufferStream.cs @@ -263,12 +263,12 @@ namespace Microsoft.AspNet.WebSockets.Protocol.Test } if (offset < 0 || offset > buffer.Length) { - throw new ArgumentOutOfRangeException("offset", offset, string.Empty); + throw new ArgumentOutOfRangeException(nameof(offset), offset, string.Empty); } if (count < 0 || count > buffer.Length - offset || (!allowEmpty && count == 0)) { - throw new ArgumentOutOfRangeException("count", count, string.Empty); + throw new ArgumentOutOfRangeException(nameof(count), count, string.Empty); } }