public void GetMessageReceiveCount_DynamicConcurrencyEnabled_ReturnsExpectedValue() { var concurrencyOptions = new ConcurrencyOptions { DynamicConcurrencyEnabled = true }; var throttleStatus = new ConcurrencyThrottleAggregateStatus { State = ThrottleState.Disabled }; var optionsWrapper = new OptionsWrapper <ConcurrencyOptions>(concurrencyOptions); var mockConcurrencyThrottleManager = new Mock <IConcurrencyThrottleManager>(MockBehavior.Strict); mockConcurrencyThrottleManager.Setup(p => p.GetStatus()).Returns(() => throttleStatus); var concurrencyManager = new ConcurrencyManager(optionsWrapper, _loggerFactory, mockConcurrencyThrottleManager.Object); var localListener = new QueueListener(_mockQueue.Object, null, _mockTriggerExecutor.Object, _mockExceptionDispatcher.Object, _loggerFactory, null, _queuesOptions, _mockQueueProcessor.Object, new FunctionDescriptor { Id = TestFunctionId }, concurrencyManager); int result = localListener.GetMessageReceiveCount(); Assert.AreEqual(1, result); }
public void GetMessageReceiveCount_ReturnsExpectedValue() { int result = _listener.GetMessageReceiveCount(); Assert.AreEqual(_mockQueueProcessor.Object.QueuesOptions.BatchSize, result); }