Skip to content

Commit

Permalink
Fix CA2208. Remove paramName becaus it is in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Marusyk committed Jan 19, 2022
1 parent 8fc59fd commit 9bfc2a5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void Test_GenerateManifest_InvalidEventSources()

e = AssertExtensions.Throws<ArgumentException>(null, () => EventSource.GenerateManifest(typeof(Sdt.EnumKindMismatchEventSource), string.Empty, strictOptions));
AsserExceptionStringsEqual(() => string.Join(Environment.NewLine,
GetResourceString("EventSource_EnumKindMismatch", "Op1", "EventKeywords"),
GetResourceString("EventSource_EnumKindMismatch", "EventKeywords", "Opcodes"),
GetResourceString("EventSource_UndefinedKeyword", "0x1", "WriteInteger")),
e);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public IList<ArraySegment<byte>>? BufferList
if (!_buffer.Equals(default))
{
// Can't have both set
throw new ArgumentException(SR.net_ambiguousbuffers, nameof(_buffer));
throw new ArgumentException(SR.net_ambiguousbuffers);
}

// Copy the user-provided list into our internal buffer list,
Expand Down Expand Up @@ -358,7 +358,7 @@ public void SetBuffer(byte[]? buffer, int offset, int count)
// Can't have both Buffer and BufferList.
if (_bufferList != null)
{
throw new ArgumentException(SR.net_ambiguousbuffers, nameof(_bufferList));
throw new ArgumentException(SR.net_ambiguousbuffers);
}

// Offset and count can't be negative and the
Expand Down Expand Up @@ -391,7 +391,7 @@ public void SetBuffer(Memory<byte> buffer)
{
if (buffer.Length != 0 && _bufferList != null)
{
throw new ArgumentException(SR.net_ambiguousbuffers, nameof(_bufferList));
throw new ArgumentException(SR.net_ambiguousbuffers);
}

_buffer = buffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ public void Ctor_Invalid()
AssertExtensions.Throws<ArgumentNullException>("replacement", () => new DecoderReplacementFallback(null));

// Invalid surrogate pair
AssertExtensions.Throws<ArgumentException>(null, () => new DecoderReplacementFallback("\uD800"));
AssertExtensions.Throws<ArgumentException>(null, () => new DecoderReplacementFallback("\uD800a"));
AssertExtensions.Throws<ArgumentException>(null, () => new DecoderReplacementFallback("\uDC00"));
AssertExtensions.Throws<ArgumentException>(null, () => new DecoderReplacementFallback("a\uDC00"));
AssertExtensions.Throws<ArgumentException>(null, () => new DecoderReplacementFallback("\uDC00\uDC00"));
AssertExtensions.Throws<ArgumentException>(null, () => new DecoderReplacementFallback("\uD800\uD800"));
AssertExtensions.Throws<ArgumentException>("replacement", () => new DecoderReplacementFallback("\uD800"));
AssertExtensions.Throws<ArgumentException>("replacement", () => new DecoderReplacementFallback("\uD800a"));
AssertExtensions.Throws<ArgumentException>("replacement", () => new DecoderReplacementFallback("\uDC00"));
AssertExtensions.Throws<ArgumentException>("replacement", () => new DecoderReplacementFallback("a\uDC00"));
AssertExtensions.Throws<ArgumentException>("replacement", () => new DecoderReplacementFallback("\uDC00\uDC00"));
AssertExtensions.Throws<ArgumentException>("replacement", () => new DecoderReplacementFallback("\uD800\uD800"));
}

public static IEnumerable<object[]> Equals_TestData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ public void Ctor_Invalid()
AssertExtensions.Throws<ArgumentNullException>("replacement", () => new EncoderReplacementFallback(null));

// Invalid surrogate pair
AssertExtensions.Throws<ArgumentException>(null, () => new EncoderReplacementFallback("\uD800"));
AssertExtensions.Throws<ArgumentException>(null, () => new EncoderReplacementFallback("\uD800a"));
AssertExtensions.Throws<ArgumentException>(null, () => new EncoderReplacementFallback("\uDC00"));
AssertExtensions.Throws<ArgumentException>(null, () => new EncoderReplacementFallback("a\uDC00"));
AssertExtensions.Throws<ArgumentException>(null, () => new EncoderReplacementFallback("\uDC00\uDC00"));
AssertExtensions.Throws<ArgumentException>(null, () => new EncoderReplacementFallback("\uD800\uD800"));
AssertExtensions.Throws<ArgumentException>("replacement", () => new EncoderReplacementFallback("\uD800"));
AssertExtensions.Throws<ArgumentException>("replacement", () => new EncoderReplacementFallback("\uD800a"));
AssertExtensions.Throws<ArgumentException>("replacement", () => new EncoderReplacementFallback("\uDC00"));
AssertExtensions.Throws<ArgumentException>("replacement", () => new EncoderReplacementFallback("a\uDC00"));
AssertExtensions.Throws<ArgumentException>("replacement", () => new EncoderReplacementFallback("\uDC00\uDC00"));
AssertExtensions.Throws<ArgumentException>("replacement", () => new EncoderReplacementFallback("\uD800\uD800"));
}

public static IEnumerable<object[]> Equals_TestData()
Expand Down

0 comments on commit 9bfc2a5

Please sign in to comment.