本文整理汇总了C#中Pipeline.Configure方法的典型用法代码示例。如果您正苦于以下问题:C# Pipeline.Configure方法的具体用法?C# Pipeline.Configure怎么用?C# Pipeline.Configure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pipeline
的用法示例。
在下文中一共展示了Pipeline.Configure方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestStepExecutionException
public void TestStepExecutionException()
{
var mockStep = new Mock<IPipelineStep<int>>();
mockStep.Setup(x => x.Execute(0)).Throws(new StepExecutionException(0, typeof(int), null));
// Act
var pipeline = new Pipeline<int>();
pipeline.Configure(new[] { mockStep.Object });
Assert.Throws<StepExecutionException>(() => pipeline.Process(0));
}
示例2: ExecutePipeline
public void ExecutePipeline()
{
// Arrange
const int expected = 2;
var mockStep = new Mock<IPipelineStep<int>>();
mockStep.Setup(x => x.Execute(0)).Returns(expected);
// Act
var pipeline = new Pipeline<int>();
pipeline.Configure(new[] { mockStep.Object });
var results = pipeline.Process(0);
// Assert
Assert.AreEqual(expected, results);
}
示例3: TestStepConfigurationExceptionWithNullList
public void TestStepConfigurationExceptionWithNullList()
{
// Act
var pipeline = new Pipeline<int>();
pipeline.Configure(null);
}
示例4: TestStepConfigurationExceptionWithListContainingNullElement
public void TestStepConfigurationExceptionWithListContainingNullElement()
{
var pipeline = new Pipeline<int>();
pipeline.Configure(new IPipelineStep<int>[] { null });
}