本文整理汇总了C#中TechTalk.SpecFlow.Parser.Gherkin.GherkinBufferSpan类的典型用法代码示例。如果您正苦于以下问题:C# GherkinBufferSpan类的具体用法?C# GherkinBufferSpan怎么用?C# GherkinBufferSpan使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GherkinBufferSpan类属于TechTalk.SpecFlow.Parser.Gherkin命名空间,在下文中一共展示了GherkinBufferSpan类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ColorizeLinePart
private void ColorizeLinePart(string value, GherkinBufferSpan span, IClassificationType classificationType)
{
var textPosition = gherkinBuffer.IndexOfTextForLine(value, span.StartPosition.Line);
if (textPosition == null)
return;
var textSpan = new GherkinBufferSpan(
textPosition,
textPosition.ShiftByCharacters(value.Length));
ColorizeSpan(textSpan, classificationType);
}
开发者ID:nandrew,项目名称:SpecFlow,代码行数:11,代码来源:GherkinFileEditorParserListener.cs
示例2: Examples
public void Examples(string keyword, string name, string description, GherkinBufferSpan headerSpan, GherkinBufferSpan descriptionSpan)
{
var position = GetFilePosition(headerSpan.StartPosition);
var exampleBuilder = new ExampleBuilder(name, description, position);
tableProcessor = exampleBuilder;
if (exampleProcessor == null)
throw new GherkinSemanticErrorException(
"Examples can only be specified for a scenario outline.", position);
exampleProcessor.ProcessExample(exampleBuilder);
}
开发者ID:nandrew,项目名称:SpecFlow,代码行数:11,代码来源:GherkinParserListener.cs
示例3: ColorizeSpan
private void ColorizeSpan(GherkinBufferSpan span, IClassificationType classificationType)
{
if (span == null)
return;
var startLine = textSnapshot.GetLineFromLineNumber(span.StartPosition.Line);
var endLine = span.StartPosition.Line == span.EndPosition.Line ? startLine :
textSnapshot.GetLineFromLineNumber(span.EndPosition.Line);
var startIndex = startLine.Start + span.StartPosition.LinePosition;
AddClassification(classificationType,
startIndex,
endLine.Start + span.EndPosition.LinePosition - startIndex);
}
开发者ID:nandrew,项目名称:SpecFlow,代码行数:14,代码来源:GherkinFileEditorParserListener.cs
示例4: ColorizeSpan
private void ColorizeSpan(GherkinBufferSpan span, IClassificationType classificationType)
{
if (span == null)
return;
var startLine = textSnapshot.GetLineFromLineNumber(span.StartPosition.Line);
var endLine = span.StartPosition.Line == span.EndPosition.Line ?
startLine : textSnapshot.GetLineFromLineNumber(span.EndPosition.Line);
var startIndex = startLine.Start + span.StartPosition.LinePosition;
var endLinePosition = span.EndPosition.LinePosition == endLine.Length ?
endLine.LengthIncludingLineBreak : span.EndPosition.LinePosition;
var length = endLine.Start + endLinePosition - startIndex;
AddClassification(classificationType, startIndex, length);
}
开发者ID:matgiro,项目名称:SpecFlow,代码行数:14,代码来源:GherkinTextBufferParserListener.cs
示例5: Comment
public void Comment(string commentText, GherkinBufferSpan commentSpan)
{
if (GherkinDialectServices.IsLanguageLine(commentText))
return;
var position = GetFilePosition(commentSpan.StartPosition);
string trimmedComment = commentText.TrimStart(' ', '#', '\t');
position.Column += commentText.Length - trimmedComment.Length;
trimmedComment = trimmedComment.Trim();
if (trimmedComment.Length == 0)
return;
featureBuilder.AddComment(trimmedComment, position);
}
开发者ID:Galad,项目名称:SpecFlow,代码行数:15,代码来源:GherkinParserListener.cs
示例6: Examples
public void Examples(string keyword, string name, string description, GherkinBufferSpan headerSpan, GherkinBufferSpan descriptionSpan)
{
//TODO: outline
RegisterKeyword(keyword, headerSpan);
ColorizeSpan(descriptionSpan, classifications.Description);
}
开发者ID:nandrew,项目名称:SpecFlow,代码行数:6,代码来源:GherkinFileEditorParserListener.cs
示例7: ScenarioOutline
public void ScenarioOutline(string keyword, string name, string description, GherkinBufferSpan headerSpan, GherkinBufferSpan descriptionSpan)
{
ScenarioEditorInfo scenario = ProcessScenario(keyword, name, headerSpan, descriptionSpan);
scenario.IsScenarioOutline = true;
}
开发者ID:nandrew,项目名称:SpecFlow,代码行数:5,代码来源:GherkinFileEditorParserListener.cs
示例8: Comment
public void Comment(string commentText, GherkinBufferSpan commentSpan)
{
ColorizeSpan(commentSpan, classifications.Comment);
}
开发者ID:nandrew,项目名称:SpecFlow,代码行数:4,代码来源:GherkinFileEditorParserListener.cs
示例9: Feature
public void Feature(string keyword, string name, string description, GherkinBufferSpan headerSpan, GherkinBufferSpan descriptionSpan)
{
ColorizeKeywordLine(keyword, headerSpan, classifications.FeatureTitle);
ColorizeSpan(descriptionSpan, classifications.Description);
}
开发者ID:nandrew,项目名称:SpecFlow,代码行数:5,代码来源:GherkinFileEditorParserListener.cs
示例10: ScenarioOutline
public void ScenarioOutline(string keyword, string name, string description, GherkinBufferSpan headerSpan, GherkinBufferSpan descriptionSpan)
{
ProcessScenario(keyword, name, headerSpan, descriptionSpan, typeof(IScenarioOutlineBlock));
}
开发者ID:matgiro,项目名称:SpecFlow,代码行数:4,代码来源:GherkinTextBufferParserListener.cs
示例11: Feature
public virtual void Feature(string keyword, string name, string description, GherkinBufferSpan headerSpan, GherkinBufferSpan descriptionSpan)
{
CurrentFileBlockBuilder.SetMainData(typeof(IHeaderBlock), headerSpan.StartPosition.Line, keyword, name);
ColorizeKeywordLine(keyword, headerSpan, classifications.FeatureTitle);
ColorizeSpan(descriptionSpan, classifications.Description);
}
开发者ID:matgiro,项目名称:SpecFlow,代码行数:7,代码来源:GherkinTextBufferParserListener.cs
示例12: MultilineText
public void MultilineText(string text, GherkinBufferSpan textSpan)
{
ColorizeSpan(textSpan, classifications.MultilineText);
if (currentStep != null)
{
currentStep.MultilineTextArgument = text;
}
else
{
//TODO: shall we mark it as error?
}
}
开发者ID:matgiro,项目名称:SpecFlow,代码行数:13,代码来源:GherkinTextBufferParserListener.cs
示例13: ScenarioTag
public void ScenarioTag(string name, GherkinBufferSpan tagSpan)
{
EnsureNewScenario(tagSpan.StartPosition.Line);
ColorizeSpan(tagSpan, classifications.Tag);
}
开发者ID:nandrew,项目名称:SpecFlow,代码行数:5,代码来源:GherkinFileEditorParserListener.cs
示例14: Step
public void Step(string keyword, StepKeyword stepKeyword, Parser.Gherkin.ScenarioBlock scenarioBlock, string text, GherkinBufferSpan stepSpan)
{
if (CurrentFileBlockBuilder.BlockType == typeof(IScenarioOutlineBlock))
{
var matches = placeholderRe.Matches(text);
foreach (Match match in matches)
ColorizeLinePart(match.Value, stepSpan, classifications.Placeholder);
}
var editorLine = stepSpan.StartPosition.Line;
var tags = FeatureTags.Concat(CurrentFileBlockBuilder.Tags).Distinct();
var stepContext = new StepContext(FeatureTitle, CurrentFileBlockBuilder.BlockType == typeof(IBackgroundBlock) ? null : CurrentFileBlockBuilder.Title, tags.ToArray(), gherkinFileScope.GherkinDialect.CultureInfo);
currentStep = new GherkinStep((StepDefinitionType)scenarioBlock, (StepDefinitionKeyword)stepKeyword, text, stepContext, keyword, editorLine - CurrentFileBlockBuilder.KeywordLine);
CurrentFileBlockBuilder.Steps.Add(currentStep);
var bindingMatchService = projectScope.BindingMatchService;
if (bindingMatchService.Ready && bindingMatchService != null)
{
List<BindingMatch> candidatingMatches;
candidatingMatches = null;
StepDefinitionAmbiguityReason ambiguityReason;
CultureInfo bindingCulture = currentStep.StepContext.Language;
var match = bindingMatchService.GetBestMatch(currentStep, bindingCulture, out ambiguityReason, out candidatingMatches);
if (candidatingMatches.Count == 0)
{
ColorizeKeywordLine(keyword, stepSpan, classifications.StepText);
}
else
{
ColorizeKeywordLine(keyword, stepSpan, classifications.KnownStepText);
foreach (String value in candidatingMatches.First().StepBinding.Regex.Split(text))
ColorizeLinePart(value, stepSpan, classifications.Variable);
}
}
else
ColorizeKeywordLine(keyword, stepSpan, classifications.StepText);
}
开发者ID:matgiro,项目名称:SpecFlow,代码行数:48,代码来源:GherkinTextBufferParserListener.cs
示例15: TableRow
public void TableRow(string[] cells, GherkinBufferSpan rowSpan, GherkinBufferSpan[] cellSpans)
{
foreach (var cellSpan in cellSpans)
{
ColorizeSpan(cellSpan, classifications.TableCell);
}
if (currentStep != null)
{
try
{
currentStep.TableArgument.AddRow(cells);
}
catch (Exception)
{
//TODO: shall we mark it as error?
}
}
//TODO: register outline example
}
开发者ID:matgiro,项目名称:SpecFlow,代码行数:19,代码来源:GherkinTextBufferParserListener.cs
示例16: ScenarioTag
public void ScenarioTag(string name, GherkinBufferSpan tagSpan)
{
EnsureNewScenario(tagSpan.StartPosition.Line);
CurrentFileBlockBuilder.Tags.Add(name.TrimStart('@'));
ColorizeSpan(tagSpan, classifications.Tag);
}
开发者ID:matgiro,项目名称:SpecFlow,代码行数:6,代码来源:GherkinTextBufferParserListener.cs
示例17: FeatureTag
public void FeatureTag(string name, GherkinBufferSpan tagSpan)
{
ColorizeSpan(tagSpan, classifications.Tag);
CurrentFileBlockBuilder.Tags.Add(name.TrimStart('@'));
}
开发者ID:matgiro,项目名称:SpecFlow,代码行数:5,代码来源:GherkinTextBufferParserListener.cs
示例18: ProcessScenario
private void ProcessScenario(string keyword, string name, GherkinBufferSpan headerSpan, GherkinBufferSpan descriptionSpan, Type blockType)
{
EnsureNewScenario(headerSpan.StartPosition.Line);
CurrentFileBlockBuilder.SetMainData(blockType, headerSpan.StartPosition.Line, keyword, name);
ColorizeKeywordLine(keyword, headerSpan, classifications.ScenarioTitle);
ColorizeSpan(descriptionSpan, classifications.Description);
}
开发者ID:matgiro,项目名称:SpecFlow,代码行数:8,代码来源:GherkinTextBufferParserListener.cs
示例19: ProcessScenario
private ScenarioEditorInfo ProcessScenario(string keyword, string name, GherkinBufferSpan headerSpan, GherkinBufferSpan descriptionSpan)
{
EnsureNewScenario(headerSpan.StartPosition.Line);
ColorizeKeywordLine(keyword, headerSpan, classifications.ScenarioTitle);
ColorizeSpan(descriptionSpan, classifications.Description);
var scenario = gherkinFileEditorInfo.ScenarioEditorInfos.Last();
scenario.KeywordLine = headerSpan.StartPosition.Line;
scenario.Title = name;
scenario.Keyword = keyword;
return scenario;
}
开发者ID:nandrew,项目名称:SpecFlow,代码行数:13,代码来源:GherkinFileEditorParserListener.cs
示例20: TableRow
public void TableRow(string[] cells, GherkinBufferSpan rowSpan, GherkinBufferSpan[] cellSpans)
{
foreach (var cellSpan in cellSpans)
{
ColorizeSpan(cellSpan, classifications.TableCell);
}
}
开发者ID:nandrew,项目名称:SpecFlow,代码行数:7,代码来源:GherkinFileEditorParserListener.cs
注:本文中的TechTalk.SpecFlow.Parser.Gherkin.GherkinBufferSpan类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论