You've already forked linux-packaging-mono
Imported Upstream version 5.8.0.22
Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
parent
5f4a27cc8a
commit
7d05485754
@@ -53,7 +53,7 @@ namespace System.IO.Tests
|
||||
AssertExtensions.Throws<ArgumentNullException>("array", () => stream.Read(null, 1, 1));
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => stream.Read(array, -1, 1));
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => stream.Read(array, 1, -1));
|
||||
Assert.Throws<ArgumentException>(() => stream.Read(array, 9, 2));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => stream.Read(array, 9, 2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace System.IO.Tests
|
||||
AssertExtensions.Throws<ArgumentNullException>("array", () => stream.Write(null, 1, 1));
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => stream.Write(array, -1, 1));
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => stream.Write(array, 1, -1));
|
||||
Assert.Throws<ArgumentException>(() => stream.Write(array, 9, 2));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => stream.Write(array, 9, 2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,6 +113,20 @@ namespace System.IO.Tests
|
||||
{
|
||||
return new BufferedStream(new MemoryStream(), bufferSize);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReadByte_ThenRead_EndOfStreamCorrectlyFound()
|
||||
{
|
||||
using (var s = new BufferedStream(new MemoryStream(new byte[] { 1, 2 }), 2))
|
||||
{
|
||||
Assert.Equal(1, s.ReadByte());
|
||||
Assert.Equal(2, s.ReadByte());
|
||||
Assert.Equal(-1, s.ReadByte());
|
||||
|
||||
Assert.Equal(0, s.Read(new byte[1], 0, 1));
|
||||
Assert.Equal(0, s.Read(new byte[1], 0, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BufferedStream_TestLeaveOpen : TestLeaveOpen
|
||||
|
||||
Reference in New Issue
Block a user