本文整理汇总了C#中Scenario.AddExamples方法的典型用法代码示例。如果您正苦于以下问题:C# Scenario.AddExamples方法的具体用法?C# Scenario.AddExamples怎么用?C# Scenario.AddExamples使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scenario
的用法示例。
在下文中一共展示了Scenario.AddExamples方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_include_examples_when_converting_to_string
public void Should_include_examples_when_converting_to_string()
{
var feature = new Feature("featureTitle", "", "source", 1);
var scenario = new Scenario("scenarioTitle", "source", feature, 3);
scenario.AddStep(new StringStep("Given a [foo]", "source, 4"));
scenario.AddStep(new StringStep("And [bar]", "source, 5"));
var columnNames = new ExampleColumns { new ExampleColumn("foo"), new ExampleColumn("bar") };
scenario.AddExamples(new[]
{
new Example(columnNames, new Dictionary<string, string>{ {"foo", "1"}, {"bar", "2"}}),
new Example(columnNames, new Dictionary<string, string>{ {"foo", "11"}, {"bar", "22"}})
});
var scenarioAsString = scenario.ToString();
string expected = string.Format("Scenario: scenarioTitle{0} Given a [foo]{0} And [bar]{0}", Environment.NewLine);
expected += "Examples:" + Environment.NewLine +
" | foo | bar |" + Environment.NewLine +
" | 1 | 2 |" + Environment.NewLine +
" | 11 | 22 |";
Assert.AreEqual(expected, scenarioAsString);
}