本文整理汇总了C#中Scenario.AddTags方法的典型用法代码示例。如果您正苦于以下问题:C# Scenario.AddTags方法的具体用法?C# Scenario.AddTags怎么用?C# Scenario.AddTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scenario
的用法示例。
在下文中一共展示了Scenario.AddTags方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Scenario
public void Scenario(Token keyword, Token title)
{
var scenario = new Scenario(title.Content, file, currentFeature, keyword.LineInFile.Line);
currentScenario = scenario;
events.Enqueue(new ScenarioEvent(currentScenario, e =>
{
scenario.AddTags(e.Tags);
ScenarioEvent.Invoke(this, new EventArgs<Scenario>(scenario));
}));
}
示例2: Should_update_stepContext_with_tags
public void Should_update_stepContext_with_tags()
{
const string featureTitle = "feature title";
var feature = new Feature(featureTitle);
feature.AddTags(new[] { "a" });
sut.OnFeatureStartedEvent(feature);
const string scenarioTitle = "scenario title";
var scenario = new Scenario(scenarioTitle, "", new Feature("ignored"));
scenario.AddTags(new[] { "a", "b" });
sut.OnScenarioStartedEvent(scenario);
var step = "Given something".AsStringStep("");
sut.OnStepStartedEvent(step);
CollectionAssert.AreEquivalent(new[] { "a", "b" }, stepContext.Tags);
}
示例3: Should_remove_tags_for_previous_scenario_when_next_scenario_is_raised
public void Should_remove_tags_for_previous_scenario_when_next_scenario_is_raised()
{
var feature = new Feature("featureTitle");
sut.OnFeatureStartedEvent(feature);
var scenario = new Scenario("scenario title", "", feature);
scenario.AddTags(new[] { "tag2" });
sut.OnScenarioStartedEvent(scenario);
sut.OnScenarioFinishedEvent();
var scenario2 = new Scenario("scenario title", "", feature);
scenario2.AddTags(new[] { "tag3" });
sut.OnScenarioStartedEvent(scenario2);
CollectionAssert.IsNotEmpty(scenarioContext.Tags);
CollectionAssert.AreEqual(new[] { "tag3" }, scenarioContext.Tags);
}
示例4: Should_set_tags_for_scenario_event
public void Should_set_tags_for_scenario_event()
{
var feature = new Feature("featureTitle");
sut.OnFeatureStartedEvent(feature);
var scenario = new Scenario("scenario title", "", feature);
scenario.AddTags(new[] { "tag" });
sut.OnScenarioStartedEvent(scenario);
CollectionAssert.AreEqual(new[] { "tag" }, scenarioContext.Tags);
}