本文整理汇总了C#中QueueManager.Add方法的典型用法代码示例。如果您正苦于以下问题:C# QueueManager.Add方法的具体用法?C# QueueManager.Add怎么用?C# QueueManager.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueueManager
的用法示例。
在下文中一共展示了QueueManager.Add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: should_remove_it_from_the_queue
public void should_remove_it_from_the_queue()
{
// Arrange
var dynamicDataFactory = new Moq.Mock<DynamicDataStoreFactory>();
dynamicDataFactory
.Setup(x => x.GetStore(typeof(QueueItem)))
.Returns(new InMemoryDynamicDataStore());
var container = EPiSimpleQueue.Infrastructure.Bootstrapper.CreateContainer();
var queueManager = new QueueManager(dynamicDataFactory.Object, new Handler(container));
queueManager.Add(new AnEvent());
queueManager.Add(new AnEvent());
queueManager.Add(new AnEvent());
// Act
queueManager.RemoveAllQueueItems();
// Assert
Assert.That(queueManager.GetQueueItems(), Is.Empty);
}
示例2: Setup
public void Setup()
{
// Arrange
_eventThatWillThrow = new AnEventThatWillThrow {Exception = new ArgumentException("Some exception")};
var dynamicDataFactory = new Moq.Mock<DynamicDataStoreFactory>();
dynamicDataFactory
.Setup(x => x.GetStore(typeof(QueueItem)))
.Returns(new InMemoryDynamicDataStore());
dynamicDataFactory
.Setup(x => x.GetStore(typeof(ErrorQueueItem)))
.Returns(new InMemoryDynamicDataStore());
var container = EPiSimpleQueue.Infrastructure.Bootstrapper.CreateContainer();
_queueManager = new QueueManager(dynamicDataFactory.Object, new Handler(container));
_queueManager.Add(_eventThatWillThrow);
_queueManager.Add(new AnEvent());
// Act
_results = _queueManager.ProcessAllQueueItems();
}