private IReadOnlyCollection <Comment> ConvertComments(Ast.GherkinDocument gherkinDocument) { return(gherkinDocument.Comments.Select(c => new Comment() { Text = c.Text, Location = ConvertLocation(c.Location) }).ToReadOnlyCollection()); }
public GherkinDocument ConvertGherkinDocumentToEventArgs(Ast.GherkinDocument gherkinDocument, string sourceEventUri) { return(new GherkinDocument() { Uri = sourceEventUri, Feature = ConvertFeature(gherkinDocument), Comments = ConvertComments(gherkinDocument) }); }
private Feature ConvertFeature(Ast.GherkinDocument gherkinDocument) { var feature = gherkinDocument.Feature; if (feature == null) { return(null); } var children = feature.Children.Select(ConvertToFeatureChild).ToReadOnlyCollection(); var tags = feature.Tags.Select(ConvertTag).ToReadOnlyCollection(); return(new Feature() { Name = CucumberMessagesDefaults.UseDefault(feature.Name, CucumberMessagesDefaults.DefaultName), Description = CucumberMessagesDefaults.UseDefault(feature.Description, CucumberMessagesDefaults.DefaultDescription), Keyword = feature.Keyword, Language = feature.Language, Location = ConvertLocation(feature.Location), Children = children, Tags = tags }); }