本文整理汇总了C#中Step.AddParameter方法的典型用法代码示例。如果您正苦于以下问题:C# Step.AddParameter方法的具体用法?C# Step.AddParameter怎么用?C# Step.AddParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Step
的用法示例。
在下文中一共展示了Step.AddParameter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DefineDemoCurrencyConverterSteps
private static Flow DefineDemoCurrencyConverterSteps()
{
var retVal = new Flow();
retVal.Add(new Step("10", "Enter 1st currency", "Plugin.ConsoleUI.PublishStringFromUI"));
retVal.Add(new Step("20", "Enter 2nd currency", "Plugin.ConsoleUI.PublishStringFromUI"));
var trickyStep = new Step("30", "Get exchange rate", "Plugin.Demo.CurrencyConverter.GetExchangeRate");
trickyStep.AddParameter("String", 1, new Parameter("String", "10", 0));
trickyStep.AddParameter("String", 2, new Parameter("String", "20", 0));
retVal.Add(trickyStep);
retVal.Add(new Step("40", "Format result", "Plugin.Demo.Calculator.FormatNumber",
new[] { new Parameter("Number", "30", 0), }));
retVal.Add(new Step("50", "Display result", "Plugin.ConsoleUI.DisplayString",
new[] { new Parameter("String", "40", 0), }));
return retVal;
}
示例2: DefineDemoCalculatorSteps
private static Flow DefineDemoCalculatorSteps()
{
var retVal = new Flow();
retVal.Add(new Step("10", "Enter 1st integer", "Plugin.ConsoleUI.PublishIntegerFromUI"));
retVal.Add(new Step("20", "Enter 2nd integer", "Plugin.ConsoleUI.PublishIntegerFromUI"));
var trickyStep = new Step("30", "Compute stuff", "Plugin.Demo.Calculator.DoArithmetic");
trickyStep.AddParameter("Integer", 100, new Parameter("Integer", "10", 0));
trickyStep.AddParameter("Integer", 200, new Parameter("Integer", "20", 0));
retVal.Add(trickyStep);
retVal.Add(new Step("40", "Format result", "Plugin.Demo.Calculator.FormatNumber",
new[] { new Parameter("Number", "30", 3), }));
retVal.Add(new Step("50", "Display result", "Plugin.ConsoleUI.DisplayString",
new[] { new Parameter("String", "40", 0), }));
return retVal;
}
示例3: ValidateAddsErrorIfNumberOfInputParametersIsMoreThanExpected
public void ValidateAddsErrorIfNumberOfInputParametersIsMoreThanExpected()
{
// Arrange
var x = new Flow();
var step = new Step(null, "PrintInt");
var prm1 = new Parameter("int", step.Id, 0);
var prm2 = new Parameter("string", step.Id, 0);
step.AddParameter(prm1);
step.AddParameter(prm2);
x.Add(step);
var actions = new CalculatorActionDefinitionProvider().Get;
// Act
var errors = x.Validate(actions);
// Assert
Assert.IsNotNull(errors);
Assert.AreEqual(1, errors.Count);
Assert.IsTrue(errors[0].Message.Contains("Number of input parameters"));
}
示例4: ValidateAddsErrorIfParameterWasNotPreviouslyPublished
public void ValidateAddsErrorIfParameterWasNotPreviouslyPublished()
{
// Arrange
var x = new Flow();
var step = new Step(null, "PrintInt");
var prm = new Parameter("int", step.Id, 0);
step.AddParameter(prm);
x.Add(step);
var actions = new CalculatorActionDefinitionProvider().Get;
// Act
var errors = x.Validate(actions);
// Assert
Assert.IsNotNull(errors);
Assert.AreEqual(1, errors.Count);
Assert.IsTrue(errors[0].Message.Contains("has not been previously published"));
}
示例5: CreateValidFlow
private static Flow CreateValidFlow()
{
var x = new Flow();
var step1 = new Step("1", "Get 1st int", "GetIntFromUI");
var step2 = new Step("2", "Get 2nd int", "GetIntFromUI");
var step3 = new Step("3", "Do the math", "DoArithmetic");
step3.AddParameter("int", 111, new Parameter("int", step1.Id, 0));
step3.AddParameter("int", 222, new Parameter("int", step2.Id, 0));
var step4 = new Step("4", "Print product", "PrintInt", new[] { new Parameter("int", step3.Id, 333) });
x.Add(step1);
x.Add(step2);
x.Add(step3);
x.Add(step4);
return x;
}