public void WriteOutOfRange(Stream framedStream) { framedStream.Length.Returns(10); framedStream.Position = 0; var frame = new FramedStream(framedStream, 6, doDispose: false); Action act = () => frame.Write(Array.Empty <byte>(), 0, 7); act.Should().Throw <ArgumentOutOfRangeException>(); }
public void Write(Stream framedStream) { framedStream.Length.Returns(10); framedStream.Position = 0; var frame = new FramedStream(framedStream, 6, doDispose: false); const int offset = 5; const int count = 3; byte[] b = new byte[10]; frame.Write(b, offset, count); framedStream.Received(1).Write(b, offset, 3); }