Skip to content
Prev Previous commit
Next Next commit
Run null TextReader tests on unique instances.
  • Loading branch information
bgrainger committed Jan 26, 2022
commit 1d3e13064882fb706e36afa960cbb8f9c870f9f2
13 changes: 4 additions & 9 deletions src/libraries/System.IO/tests/Stream/Stream.NullTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,10 @@ public void DisposeAsync_Nop()
Stream.Null.Write(new byte[42]); // still usable
}

public static IEnumerable<object[]> NullReaders
{
get
{
yield return new object[] { TextReader.Null };
yield return new object[] { StreamReader.Null };
yield return new object[] { StringReader.Null };
}
}
public static IEnumerable<object[]> NullReaders =>
new[] { TextReader.Null, StreamReader.Null, StringReader.Null }
.Distinct()
.Select(x => new object[] { x });

public static IEnumerable<object[]> NullWriters
{
Expand Down