当前位置: 首页>>代码示例>>C#>>正文


C# Step.AddParameter方法代码示例

本文整理汇总了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;
 }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:15,代码来源:DemoFlowBuilder.cs

示例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;
 }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:15,代码来源:DemoFlowBuilder.cs

示例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"));
        }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:20,代码来源:ValidateFlowTests.cs

示例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"));
        }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:18,代码来源:ValidateFlowTests.cs

示例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;
        }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:16,代码来源:ValidateFlowTests.cs


注:本文中的Step.AddParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。