Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotCallConsumerProvidingTheDescriptionWhenThresholdIsFalse()
        public virtual void ShouldNotCallConsumerProvidingTheDescriptionWhenThresholdIsFalse()
        {
            // Given
            AbstractCheckPointThreshold threshold = new TheAbstractCheckPointThreshold(false, null);

            // When
            threshold.IsCheckPointingNeeded(42, s =>
            {
                throw new System.InvalidOperationException("nooooooooo!");
            });

            // Then
            // should not throw
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCallConsumerProvidingTheDescriptionWhenThresholdIsTrue()
        public virtual void ShouldCallConsumerProvidingTheDescriptionWhenThresholdIsTrue()
        {
            // Given
            string description = "description";
            AbstractCheckPointThreshold threshold = new TheAbstractCheckPointThreshold(true, description);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.concurrent.atomic.AtomicReference<String> calledWith = new java.util.concurrent.atomic.AtomicReference<>();
            AtomicReference <string> calledWith = new AtomicReference <string>();

            // When
            threshold.IsCheckPointingNeeded(42, calledWith.set);

            // Then
            assertEquals(description, calledWith.get());
        }