コード例 #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);
        }
コード例 #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);
        }
コード例 #3
0
ファイル: HttpResponseStreamTest.cs プロジェクト: txdv/manos
        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);
        }
コード例 #4
0
ファイル: HttpResponseStreamTest.cs プロジェクト: txdv/manos
        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);
        }
コード例 #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);
        }
コード例 #6
0
ファイル: HttpResponseStreamTest.cs プロジェクト: txdv/manos
        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);
        }