本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
示例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");
}
}
示例5: Format
public void Format(Body body, string description)
{
foreach (var paragraph in SplitDescription(description))
{
body.GenerateParagraph(paragraph, "Normal");
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}