Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public Span<T> GetSpan(int sizeHint = 0)
private void CheckAndResizeBuffer(int sizeHint)
{
if (sizeHint < 0)
throw new ArgumentException(nameof(sizeHint));
throw new ArgumentException(null, nameof(sizeHint));

if (sizeHint == 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,10 @@ public void InvalidGetMemoryAndSpan()
{
var output = new ArrayBufferWriter<T>();
WriteData(output, 2);
Assert.Throws<ArgumentException>(() => output.GetSpan(-1));
Assert.Throws<ArgumentException>(() => output.GetMemory(-1));
ArgumentException ex1 = Assert.Throws<ArgumentException>(() => output.GetSpan(-1));
Assert.Equal("sizeHint", ex1.ParamName);
ArgumentException ex2 = Assert.Throws<ArgumentException>(() => output.GetMemory(-1));
Assert.Equal("sizeHint", ex2.ParamName);
}

[Fact]
Expand Down
Loading