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


C# Body.GenerateParagraph方法代码示例

本文整理汇总了C#中Body.GenerateParagraph方法的典型用法代码示例。如果您正苦于以下问题:C# Body.GenerateParagraph方法的具体用法?C# Body.GenerateParagraph怎么用?C# Body.GenerateParagraph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Body的用法示例。


在下文中一共展示了Body.GenerateParagraph方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Format

        public void Format(Body body, ScenarioOutline scenarioOutline)
        {
            if (this.configuration.HasTestResults)
            {
                TestResult testResult = this.testResults.GetScenarioOutlineResult(scenarioOutline);
                if (testResult == TestResult.Passed)
                {
                    body.GenerateParagraph("Passed", "Passed");
                }
                else if (testResult == TestResult.Failed)
                {
                    body.GenerateParagraph("Failed", "Failed");
                }
            }

            body.GenerateParagraph(scenarioOutline.Name, "Heading2");
            if (!string.IsNullOrEmpty(scenarioOutline.Description))
            {
                body.GenerateParagraph(scenarioOutline.Description, "Normal");
            }

            foreach (Step step in scenarioOutline.Steps)
            {
                this.wordStepFormatter.Format(body, step);
            }

            foreach (var example in scenarioOutline.Examples)
            {
                body.GenerateParagraph("Examples: " + example.Description, "Heading3");
                this.wordTableFormatter.Format(body, example.TableArgument);
            }
        }
开发者ID:picklesdoc,项目名称:pickles,代码行数:32,代码来源:WordScenarioOutlineFormatter.cs

示例2: Format

        public void Format(Body body, Scenario scenario)
        {
            if (this.configuration.HasTestResults)
            {
                TestResult testResult = this.nunitResults.GetScenarioResult(scenario);
                if (testResult.WasExecuted && testResult.WasSuccessful)
                {
                    body.GenerateParagraph("Passed", "Passed");
                }
                else if (testResult.WasExecuted && !testResult.WasSuccessful)
                {
                    body.GenerateParagraph("Failed", "Failed");
                }
            }

            body.GenerateParagraph(scenario.Name, "Heading2");
            if (!string.IsNullOrEmpty(scenario.Description))
            {
                body.GenerateParagraph(scenario.Description, "Normal");
            }

            foreach (Step step in scenario.Steps)
            {
                this.wordStepFormatter.Format(body, step);
            }
        }
开发者ID:vavavivi,项目名称:pickles,代码行数:26,代码来源:WordScenarioFormatter.cs

示例3: Format

        public void Format(Body body, ScenarioOutline scenarioOutline)
        {
            if (configuration.HasTestResults)
            {
                TestResult testResult = testResults.GetScenarioOutlineResult(scenarioOutline);
                if (testResult.WasExecuted && testResult.WasSuccessful)
                {
                    body.GenerateParagraph("Passed", "Passed");
                }
                else if (testResult.WasExecuted && !testResult.WasSuccessful)
                {
                    body.GenerateParagraph("Failed", "Failed");
                }
            }

            body.GenerateParagraph(scenarioOutline.Name, "Heading2");
            if (!string.IsNullOrEmpty(scenarioOutline.Description))
                body.GenerateParagraph(scenarioOutline.Description, "Normal");

            foreach (Step step in scenarioOutline.Steps)
            {
                wordStepFormatter.Format(body, step);
            }

            body.GenerateParagraph("Examples:", "Heading3");
            wordTableFormatter.Format(body, scenarioOutline.Example.TableArgument);
        }
开发者ID:ppnrao,项目名称:pickles,代码行数:27,代码来源:WordScenarioOutlineFormatter.cs

示例4: Format

 public void Format(Body body, string description)
 {
     foreach (var paragraph in description.Split(new string[] {"\n", "\r"}, StringSplitOptions.RemoveEmptyEntries))
     {
         body.GenerateParagraph(paragraph, "Normal");
     }
 }
开发者ID:eduaquiles,项目名称:pickles,代码行数:7,代码来源:WordDescriptionFormatter.cs

示例5: Format

 public void Format(Body body, string description)
 {
     foreach (var paragraph in SplitDescription(description))
     {
         body.GenerateParagraph(paragraph, "Normal");
     }
 }
开发者ID:Jaykul,项目名称:pickles,代码行数:7,代码来源:WordDescriptionFormatter.cs

示例6: Format

        public void Format(Body body, Step step)
        {
            // HACK - We need to generate a custom paragraph here because 2 Run objects are needed to allow for the bolded keyword
            var paragraph = new Paragraph(new ParagraphProperties(new ParagraphStyleId {Val = "Normal"}));
            paragraph.Append(new Run(new RunProperties(new Bold()), new Text(step.NativeKeyword)));
            var nameText = new Text {Space = SpaceProcessingModeValues.Preserve};
            nameText.Text = " " + step.Name;
            paragraph.Append(new Run(nameText));
            body.Append(paragraph);

            if (!string.IsNullOrEmpty(step.DocStringArgument))
            {
                string[] lines = step.DocStringArgument.Split(new[] {Environment.NewLine},
                                                              StringSplitOptions.RemoveEmptyEntries);
                foreach (string line in lines)
                {
                    body.GenerateParagraph(line, "Quote");
                }
            }

            if (step.TableArgument != null)
            {
                this.wordTableFormatter.Format(body, step.TableArgument);
            }
        }
开发者ID:eduaquiles,项目名称:pickles,代码行数:25,代码来源:WordStepFormatter.cs

示例7: Format

        public void Format(Body body, FeatureNode featureNode)
        {
            Feature feature = featureNode.Feature;

            body.InsertPageBreak();

            if (this.configuration.HasTestResults)
            {
                TestResult testResult = this.nunitResults.GetFeatureResult(feature);
                if (testResult.WasExecuted && testResult.WasSuccessful)
                {
                    body.GenerateParagraph("Passed", "Passed");
                }
                else if (testResult.WasExecuted && !testResult.WasSuccessful)
                {
                    body.GenerateParagraph("Failed", "Failed");
                }
            }

            body.GenerateParagraph(feature.Name, "Heading1");
            this.wordDescriptionFormatter.Format(body, feature.Description);

            if (feature.Background != null)
            {
                this.wordBackgroundFormatter.Format(body, feature.Background);
            }

            foreach (IFeatureElement featureElement in feature.FeatureElements)
            {
                var scenario = featureElement as Scenario;
                if (scenario != null)
                {
                    this.wordScenarioFormatter.Format(body, scenario);
                }

                var scenarioOutline = featureElement as ScenarioOutline;
                if (scenarioOutline != null)
                {
                    this.wordScenarioOutlineFormatter.Format(body, scenarioOutline);
                }
            }
        }
开发者ID:Narmical,项目名称:pickles,代码行数:42,代码来源:WordFeatureFormatter.cs

示例8: Format

        public void Format(Body body, Step step)
        {
            var paragraph = GenerateStepParagraph(step);
            body.Append(paragraph);

            if (!string.IsNullOrEmpty(step.DocStringArgument))
            {
                string[] lines = step.DocStringArgument.Split(new[] { Environment.NewLine },
                                                              StringSplitOptions.RemoveEmptyEntries);
                foreach (string line in lines)
                {
                    body.GenerateParagraph(line, "Quote");
                }
            }

            if (step.TableArgument != null)
            {
                this.wordTableFormatter.Format(body, step.TableArgument);
            }
        }
开发者ID:Jaykul,项目名称:pickles,代码行数:20,代码来源:WordStepFormatter.cs


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