//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReadAndCacheFirstCommittedTransactionIdForAGivenVersionWhenNotCached() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldReadAndCacheFirstCommittedTransactionIdForAGivenVersionWhenNotCached()
        {
            TransactionLogFileInformation info = new TransactionLogFileInformation(_logFiles, _logHeaderCache, _context);
            long expected = 5;

            long version = 10L;

            when(_logHeaderCache.getLogHeader(version)).thenReturn(null);
            when(_logFiles.versionExists(version)).thenReturn(true);
            when(_logFiles.extractHeader(version)).thenReturn(new LogHeader((sbyte)-1, -1L, expected - 1L)
                                                              );

            long firstCommittedTxId = info.GetFirstEntryId(version);

            assertEquals(expected, firstCommittedTxId);
            verify(_logHeaderCache, times(1)).putHeader(version, expected - 1);
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public java.util.List<org.neo4j.kernel.impl.transaction.log.entry.CheckPoint> find(long version) throws java.io.IOException
            public virtual IList <CheckPoint> Find(long version)
            {
                IList <CheckPoint> checkPoints = new List <CheckPoint>();

                for ( ; version >= INITIAL_LOG_VERSION && LogFiles.versionExists(version); version--)
                {
                    LogVersionedStoreChannel             channel = LogFiles.openForVersion(version);
                    ReadableClosablePositionAwareChannel recoveredDataChannel = new ReadAheadLogChannel(channel);

                    using (LogEntryCursor cursor = new LogEntryCursor(LogEntryReader, recoveredDataChannel))
                    {
                        while (cursor.Next())
                        {
                            LogEntry entry = cursor.Get();
                            if (entry is CheckPoint)
                            {
                                checkPoints.Add(entry.As());
                            }
                        }
                    }
                }
                return(checkPoints);
            }