Exemplo n.º 1
0
        override public void Run()
        {
            BufferChunk bc = new BufferChunk(new byte[]{1, 2, 3}, 1, 2);
            bc.Reset(2, 1);

            if(bc.Length != 1)
            {
                throw new TestCaseException("unexpected length");
            }
        }
Exemplo n.º 2
0
        override public void Run()
        {
            BufferChunk bc = new BufferChunk(new byte[]{1, 2, 3}, 1, 2);
            bc.Reset(2, 1);

            if(bc.Index != 2)
            {
                throw new TestCaseException("unexpected index");
            }
        }
Exemplo n.º 3
0
 override public void Run()
 {
     BufferChunk bc = new BufferChunk(new byte[]{1, 2, 3}, 1, 2);
     bc.Reset(0, 1);
 }
Exemplo n.º 4
0
        override public void Run()
        {
            BufferChunk bc = new BufferChunk(new byte[]{1, 2, 3}, 1, 2);

            try
            {
                bc.Reset(2, 2);
                throw new TestCaseException("index + length > buffer.Length");
            }
            catch(ArgumentOutOfRangeException){}
        }
Exemplo n.º 5
0
        override public void Run()
        {
            BufferChunk bc = new BufferChunk(new byte[]{1, 2, 3}, 1, 2);

            try
            {
                bc.Reset(0, -1);
                throw new TestCaseException("length cannot be < 0");
            }
            catch(ArgumentException){}
        }