Skip to content

Commit

Permalink
Update DataStreamTest.cs (#1405)
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnny Pham authored Nov 24, 2021
1 parent 43f7880 commit 78676d6
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,7 @@ private static void ReadStream(string connectionString)
DataTestUtility.AssertThrowsWrapper<ArgumentOutOfRangeException>(() => stream.Read(buffer, 2, -1));

// ArgumentException is thrown in net5 and earlier. ArgumentOutOfRangeException in net6 and later
ArgumentException ex = Assert.ThrowsAny<ArgumentException>(() => stream.Read(buffer, buffer.Length, buffer.Length));
Assert.True(ex.GetType() == typeof(ArgumentException) || ex.GetType() == typeof(ArgumentOutOfRangeException),
"Expected: ArgumentException in net5 and earlier. ArgumentOutOfRangeException in net6 and later.");
ex = Assert.ThrowsAny<ArgumentException>(() => stream.Read(buffer, int.MaxValue, int.MaxValue));
Expand Down

0 comments on commit 78676d6

Please sign in to comment.