コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustNotCheckForOutOfBoundsWhenReadingSingleRecord() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustNotCheckForOutOfBoundsWhenReadingSingleRecord()
        {
            MyRecordFormat format = new MyRecordFormat(this);
            StubPageCursor cursor = new StubPageCursor(0, 3);

            format.Read(new MyRecord(this, 0), cursor, RecordLoad.NORMAL, 4);
            assertFalse(cursor.CheckAndClearBoundsFlag());
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustCheckForOutOfBoundsWhenReadingDoubleRecord() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustCheckForOutOfBoundsWhenReadingDoubleRecord()
        {
            MyRecordFormat format = new MyRecordFormat(this);
            StubPageCursor cursor = new StubPageCursor(0, 4);

            cursor.PutByte(0, ( sbyte )(HEADER_BIT_RECORD_UNIT + HEADER_BIT_FIRST_RECORD_UNIT));
            StubPagedFile pagedFile = new StubPagedFileAnonymousInnerClass(this, cursor);

            format.ShortsPerRecordConflict.AddLast(2);
            format.Read(new MyRecord(this, 0), cursor, RecordLoad.NORMAL, 4);
            assertTrue(cursor.CheckAndClearBoundsFlag());
        }