Skip to content

Commit

Permalink
Adding a couple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mathewc committed Feb 21, 2017
1 parent 5c14431 commit bd5891d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Expand Up @@ -617,9 +617,11 @@ public QueueProcessor Create(QueueProcessorFactoryContext context)
// demonstrates how queue options can be customized
context.Queue.EncodeMessage = true;

// demonstrates how batch processing behavior can be customized
// demonstrates how batch processing behavior and other knobs
// can be customized
context.BatchSize = 30;
context.NewBatchThreshold = 100;
context.MaxPollingInterval = TimeSpan.FromSeconds(15);

CustomQueueProcessor processor = new CustomQueueProcessor(context);
CustomQueueProcessors.Add(processor);
Expand Down
Expand Up @@ -42,7 +42,8 @@ public void Constructor_DefaultsValues()
BatchSize = 32,
MaxDequeueCount = 2,
NewBatchThreshold = 100,
VisibilityTimeout = TimeSpan.FromSeconds(30)
VisibilityTimeout = TimeSpan.FromSeconds(30),
MaxPollingInterval = TimeSpan.FromSeconds(15)
};
QueueProcessorFactoryContext context = new QueueProcessorFactoryContext(_queue, _trace, config);
QueueProcessor localProcessor = new QueueProcessor(context);
Expand All @@ -51,6 +52,7 @@ public void Constructor_DefaultsValues()
Assert.Equal(config.MaxDequeueCount, localProcessor.MaxDequeueCount);
Assert.Equal(config.NewBatchThreshold, localProcessor.NewBatchThreshold);
Assert.Equal(config.VisibilityTimeout, localProcessor.VisibilityTimeout);
Assert.Equal(config.MaxPollingInterval, localProcessor.MaxPollingInterval);
}

[Fact]
Expand Down
Expand Up @@ -30,6 +30,7 @@ public void Constructor_DefaultsValues()
Assert.Equal(queuesConfig.BatchSize, context.BatchSize);
Assert.Equal(queuesConfig.NewBatchThreshold, context.NewBatchThreshold);
Assert.Equal(queuesConfig.MaxDequeueCount, context.MaxDequeueCount);
Assert.Equal(queuesConfig.MaxPollingInterval, context.MaxPollingInterval);
}
}
}

0 comments on commit bd5891d

Please sign in to comment.