//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldHoldSharedIndexLockIfNodeIsExists() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldHoldSharedIndexLockIfNodeIsExists()
        {
            // given
            NodeValueIndexCursor cursor = mock(typeof(NodeValueIndexCursor));

            when(cursor.Next()).thenReturn(true);
            when(cursor.NodeReference()).thenReturn(42L);

            // when
            long nodeId = LockingNodeUniqueIndexSeek.Apply(_locks, LockTracer.NONE, () => cursor, _uniqueNodeIndexSeeker, _read, _index, _predicate);

            // then
            assertEquals(42L, nodeId);
            verify(_locks).acquireShared(LockTracer.NONE, INDEX_ENTRY, _resourceId);
            verifyNoMoreInteractions(_locks);

            verify(cursor).close();
        }