public void Insert_BeginningOfStream_SetsCorrectPosition() { var stream = new HttpResponseStream (); var write_buffer = new byte [10]; stream.Write (write_buffer, 0, 10); stream.Position = 0; stream.Insert (write_buffer, 0, 5); var position = stream.Position; Assert.AreEqual (5, position); }
public void Insert_BeginningOfStream_SetsCorrectLength() { var stream = new HttpResponseStream (); var write_buffer = new byte [10]; stream.Write (write_buffer, 0, 10); stream.Position = 0; stream.Insert (write_buffer, 0, 10); var length = stream.Length; Assert.AreEqual (20, length); }
public void Insert_BeginningOfStream_SetsCorrectPosition() { var stream = new HttpResponseStream(); var write_buffer = new byte [10]; stream.Write(write_buffer, 0, 10); stream.Position = 0; stream.Insert(write_buffer, 0, 5); var position = stream.Position; Assert.AreEqual(5, position); }
public void Insert_BeginningOfStream_SetsCorrectLength() { var stream = new HttpResponseStream(); var write_buffer = new byte [10]; stream.Write(write_buffer, 0, 10); stream.Position = 0; stream.Insert(write_buffer, 0, 10); var length = stream.Length; Assert.AreEqual(20, length); }
public void Insert_BeginningOfStream_SetsCorrectData() { var stream = new HttpResponseStream (); var write_buffer = new byte [10]; var write_buffer2 = new byte [10]; stream.Write (write_buffer, 0, 10); stream.Position = 0; write_buffer2 [2] = 0xFA; stream.Insert (write_buffer2, 0, 10); stream.Position = 2; var data = stream.ReadByte (); Assert.AreEqual (0xFA, data); }
public void Insert_BeginningOfStream_SetsCorrectData() { var stream = new HttpResponseStream(); var write_buffer = new byte [10]; var write_buffer2 = new byte [10]; stream.Write(write_buffer, 0, 10); stream.Position = 0; write_buffer2 [2] = 0xFA; stream.Insert(write_buffer2, 0, 10); stream.Position = 2; var data = stream.ReadByte(); Assert.AreEqual(0xFA, data); }