本文整理汇总了C#中Feature.AddTags方法的典型用法代码示例。如果您正苦于以下问题:C# Feature.AddTags方法的具体用法?C# Feature.AddTags怎么用?C# Feature.AddTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feature
的用法示例。
在下文中一共展示了Feature.AddTags方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_set_tags_for_feature_event
public void Should_set_tags_for_feature_event()
{
var feature = new Feature("featureTitle");
feature.AddTags(new[] { "tag1", "tag2" });
sut.OnFeatureStartedEvent(feature);
CollectionAssert.AreEqual(new[] { "tag1", "tag2" }, featureContext.Tags);
}
示例2: Should_remove_tags_before_new_feature_starts
public void Should_remove_tags_before_new_feature_starts()
{
var feature = new Feature("featureTitle");
feature.AddTags(new[] { "tag1", "tag2" });
sut.OnFeatureStartedEvent(feature);
CollectionAssert.IsNotEmpty(featureContext.Tags);
sut.OnFeatureFinishedEvent();
CollectionAssert.IsNotEmpty(featureContext.Tags);
sut.OnFeatureStartedEvent(new Feature("featureTitle 2"));
CollectionAssert.IsEmpty(featureContext.Tags);
}
示例3: CreateFeature
private void CreateFeature(string title, string narrative, int sourceLine)
{
var feature = new Feature(title, narrative, file, sourceLine);
currentFeature = feature;
events.Enqueue(new FeatureEvent(feature, e =>
{
feature.AddTags(e.Tags);
FeatureEvent.Invoke(this, new EventArgs<Feature>(feature));
}));
}
示例4: 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);
}