Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldFailOnInvalidValues()
        internal virtual void ShouldFailOnInvalidValues()
        {
            // GIVEN
            PageCursor cursor = ByteArrayPageCursor.wrap(10);

            // WHEN
            for (int i = 0; i < 1_000;)
            {
                long expected = _random.nextLong();
                if ((expected & ~_6B_MASK) != 0)
                {
                    // OK here we have an invalid value
                    cursor.Offset = 0;
                    assertThrows(typeof(System.ArgumentException), () => PageCursorUtil.put6BLong(cursor, expected));
                    i++;
                }
            }
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldPutAndGet6BLongs()
        internal virtual void ShouldPutAndGet6BLongs()
        {
            // GIVEN
            PageCursor cursor = ByteArrayPageCursor.wrap(10);

            // WHEN
            for (int i = 0; i < 1_000; i++)
            {
                long expected = _random.nextLong() & _6B_MASK;
                cursor.Offset = 0;
                PageCursorUtil.Put6BLong(cursor, expected);
                cursor.Offset = 0;
                long read = PageCursorUtil.Get6BLong(cursor);

                // THEN
                assertEquals(expected, read);
                assertTrue(read >= 0);
                assertEquals(0, read & ~_6B_MASK);
            }
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @BeforeEach void setUp()
        internal virtual void SetUp()
        {
            _cursor = ByteArrayPageCursor.wrap(8192);
        }