コード例 #1
0
 private IReadOnlyCollection <Comment> ConvertComments(Ast.GherkinDocument gherkinDocument)
 {
     return(gherkinDocument.Comments.Select(c =>
                                            new Comment()
     {
         Text = c.Text,
         Location = ConvertLocation(c.Location)
     }).ToReadOnlyCollection());
 }
コード例 #2
0
 public GherkinDocument ConvertGherkinDocumentToEventArgs(Ast.GherkinDocument gherkinDocument, string sourceEventUri)
 {
     return(new GherkinDocument()
     {
         Uri = sourceEventUri,
         Feature = ConvertFeature(gherkinDocument),
         Comments = ConvertComments(gherkinDocument)
     });
 }
コード例 #3
0
        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
            });
        }