//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldAllowIncrementDecrementClientsWhileNotClosed() public virtual void ShouldAllowIncrementDecrementClientsWhileNotClosed() { // given LockClientStateHolder lockClientStateHolder = new LockClientStateHolder(); // expect assertFalse(lockClientStateHolder.HasActiveClients()); lockClientStateHolder.incrementActiveClients(new NoOpClient()); assertTrue(lockClientStateHolder.HasActiveClients()); lockClientStateHolder.incrementActiveClients(new NoOpClient()); lockClientStateHolder.incrementActiveClients(new NoOpClient()); lockClientStateHolder.DecrementActiveClients(); lockClientStateHolder.DecrementActiveClients(); lockClientStateHolder.DecrementActiveClients(); assertFalse(lockClientStateHolder.HasActiveClients()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldBeAbleToResetAndReuseClientState() public virtual void ShouldBeAbleToResetAndReuseClientState() { // given LockClientStateHolder lockClientStateHolder = new LockClientStateHolder(); // when lockClientStateHolder.incrementActiveClients(new NoOpClient()); lockClientStateHolder.incrementActiveClients(new NoOpClient()); lockClientStateHolder.DecrementActiveClients(); // expect assertTrue(lockClientStateHolder.HasActiveClients()); // and when lockClientStateHolder.StopClient(); // expect assertTrue(lockClientStateHolder.HasActiveClients()); assertTrue(lockClientStateHolder.Stopped); // and when lockClientStateHolder.Reset(); // expect assertFalse(lockClientStateHolder.HasActiveClients()); assertFalse(lockClientStateHolder.Stopped); // when lockClientStateHolder.incrementActiveClients(new NoOpClient()); assertTrue(lockClientStateHolder.HasActiveClients()); assertFalse(lockClientStateHolder.Stopped); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldBeAbleToDecrementActiveItemAndDetectWhenFree() public virtual void ShouldBeAbleToDecrementActiveItemAndDetectWhenFree() { // given LockClientStateHolder lockClientStateHolder = new LockClientStateHolder(); // when lockClientStateHolder.incrementActiveClients(new NoOpClient()); lockClientStateHolder.incrementActiveClients(new NoOpClient()); lockClientStateHolder.DecrementActiveClients(); lockClientStateHolder.incrementActiveClients(new NoOpClient()); // expect assertTrue(lockClientStateHolder.HasActiveClients()); // and when lockClientStateHolder.StopClient(); // expect assertTrue(lockClientStateHolder.HasActiveClients()); lockClientStateHolder.DecrementActiveClients(); assertTrue(lockClientStateHolder.HasActiveClients()); lockClientStateHolder.DecrementActiveClients(); assertFalse(lockClientStateHolder.HasActiveClients()); }