Example #1
0
        public void Page_locator_must_not_return_true_on_invalid_page_number()
        {
            using (var tx = Env.WriteTransaction())
            {
                var pageLocator = new PageLocator(tx.LowLevelTransaction);

                Assert.False(pageLocator.TryGetReadOnlyPage(-1, out _));

                Assert.False(pageLocator.TryGetWritablePage(-1, out _));
            }
        }
Example #2
0
        public Page GetPage(long pageNumber)
        {
            if (_disposed)
            {
                ThrowObjectDisposed();
            }

            if (_pageLocator.TryGetReadOnlyPage(pageNumber, out Page result))
            {
                return(result);
            }

            return(GetPageInternal(pageNumber));
        }