Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustNotTriggerOnTransactionCountAtThresholdIfCheckPointAlreadyHappened()
        public virtual void MustNotTriggerOnTransactionCountAtThresholdIfCheckPointAlreadyHappened()
        {
            WithIntervalTx(2);
            CheckPointThreshold threshold = CreateThreshold();

            threshold.Initialize(2);

            threshold.CheckPointHappened(4);
            assertFalse(threshold.IsCheckPointingNeeded(4, NotTriggered));
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustNotTriggerWhenTransactionCountIsWithinThresholdSinceLastTrigger()
        public virtual void MustNotTriggerWhenTransactionCountIsWithinThresholdSinceLastTrigger()
        {
            WithIntervalTx(2);
            CheckPointThreshold threshold = CreateThreshold();

            threshold.Initialize(2);

            threshold.CheckPointHappened(4);
            assertFalse(threshold.IsCheckPointingNeeded(5, NotTriggered));
        }
Exemple #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustTriggerOnTransactionCountWhenCountIsAtThresholdSinceLastCheckPoint()
        public virtual void MustTriggerOnTransactionCountWhenCountIsAtThresholdSinceLastCheckPoint()
        {
            WithIntervalTx(2);
            CheckPointThreshold threshold = CreateThreshold();

            threshold.Initialize(2);

            threshold.CheckPointHappened(4);
            assertTrue(threshold.IsCheckPointingNeeded(6, Triggered));
            VerifyTriggered("count");
            VerifyNoMoreTriggers();
        }
Exemple #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustNotTriggerPastTimeThresholdSinceLastCheckpointWithNoNewTransactions()
        public virtual void MustNotTriggerPastTimeThresholdSinceLastCheckpointWithNoNewTransactions()
        {
            WithIntervalTime("100ms");
            CheckPointThreshold threshold = CreateThreshold();

            threshold.Initialize(2);

            Clock.forward(199, MILLISECONDS);
            threshold.CheckPointHappened(42);
            Clock.forward(100, MILLISECONDS);

            assertFalse(threshold.IsCheckPointingNeeded(42, NotTriggered));
            VerifyNoMoreTriggers();
        }