//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldThrowWhenCachingATxWithNegativeOffsetPosition() public virtual void ShouldThrowWhenCachingATxWithNegativeOffsetPosition() { // given //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.kernel.impl.transaction.log.TransactionMetadataCache cache = new org.neo4j.kernel.impl.transaction.log.TransactionMetadataCache(); TransactionMetadataCache cache = new TransactionMetadataCache(); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.kernel.impl.transaction.log.LogPosition position = new org.neo4j.kernel.impl.transaction.log.LogPosition(3, -1); LogPosition position = new LogPosition(3, -1); const int txId = 42; const int masterId = 0; const int authorId = 1; const int checksum = 2; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final long timestamp = System.currentTimeMillis(); long timestamp = DateTimeHelper.CurrentUnixTimeMillis(); // when try { cache.CacheTransactionMetadata(txId, position, masterId, authorId, checksum, timestamp); fail(); } catch (Exception ex) { assertEquals("StartEntry.position is " + position, ex.Message); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReturnTheTxValueTIfInTheCached() public virtual void ShouldReturnTheTxValueTIfInTheCached() { // given //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.kernel.impl.transaction.log.TransactionMetadataCache cache = new org.neo4j.kernel.impl.transaction.log.TransactionMetadataCache(); TransactionMetadataCache cache = new TransactionMetadataCache(); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.kernel.impl.transaction.log.LogPosition position = new org.neo4j.kernel.impl.transaction.log.LogPosition(3, 4); LogPosition position = new LogPosition(3, 4); const int txId = 42; const int masterId = 0; const int authorId = 1; const int checksum = 2; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final long timestamp = System.currentTimeMillis(); long timestamp = DateTimeHelper.CurrentUnixTimeMillis(); // when cache.CacheTransactionMetadata(txId, position, masterId, authorId, checksum, timestamp); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.kernel.impl.transaction.log.TransactionMetadataCache.TransactionMetadata metadata = cache.getTransactionMetadata(txId); TransactionMetadataCache.TransactionMetadata metadata = cache.GetTransactionMetadata(txId); // then assertEquals(new TransactionMetadataCache.TransactionMetadata(masterId, authorId, position, checksum, timestamp), metadata); }