Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldDoNothingWithClientWhenPreparingForCommitWithNoLocksAcquired()
        public virtual void ShouldDoNothingWithClientWhenPreparingForCommitWithNoLocksAcquired()
        {
            // GIVEN
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final Locks_Client client = mock(Locks_Client.class);
            Locks_Client client = mock(typeof(Locks_Client));
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final DeferringStatementLocks statementLocks = new DeferringStatementLocks(client);
            DeferringStatementLocks statementLocks = new DeferringStatementLocks(client);

            // WHEN
            statementLocks.PrepareForCommit(LockTracer.NONE);

            // THEN
            verify(client).prepare();
            verifyNoMoreInteractions(client);
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldPrepareExplicitForCommitWhenLocksAcquire()
        public virtual void ShouldPrepareExplicitForCommitWhenLocksAcquire()
        {
            // GIVEN
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final Locks_Client client = mock(Locks_Client.class);
            Locks_Client client = mock(typeof(Locks_Client));
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final DeferringStatementLocks statementLocks = new DeferringStatementLocks(client);
            DeferringStatementLocks statementLocks = new DeferringStatementLocks(client);

            // WHEN
            statementLocks.Optimistic().acquireExclusive(LockTracer.NONE, ResourceTypes.Node, 1);
            statementLocks.Optimistic().acquireExclusive(LockTracer.NONE, ResourceTypes.Relationship, 42);
            verify(client, never()).acquireExclusive(eq(LockTracer.NONE), any(typeof(ResourceType)), anyLong());
            statementLocks.PrepareForCommit(LockTracer.NONE);

            // THEN
            verify(client).prepare();
            verify(client).acquireExclusive(LockTracer.NONE, ResourceTypes.Node, 1);
            verify(client).acquireExclusive(LockTracer.NONE, ResourceTypes.Relationship, 42);
            verifyNoMoreInteractions(client);
        }