Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
        }