示例#1
0
 public Feature(string title, Tags tags, string description, Background background, params Scenario[] scenarios)
 {
     Tags = tags;
     Description = description ?? string.Empty;
     Background = background;
     Scenarios = scenarios;
     Title = title;
 }
示例#2
0
 public Feature(Text title, Tags tags, DescriptionLine[] description, Background background, params Scenario[] scenarios)
 {
     Tags = tags;
     Description = description == null ? string.Empty : string.Join(Environment.NewLine, description.Select(d => d.LineText.Trim()).ToArray());
     Background = background;
     Scenarios = scenarios;
     Title = title.Value;
 }
示例#3
0
 public Feature(string keyword, string title, Tags tags, string description, Background background, Scenario[] scenarios, Comment[] comments)
 {
     Keyword = keyword;
     Title = title;
     Tags = tags;
     Description = description ?? string.Empty;
     Background = background;
     Scenarios = scenarios;
     Comments = comments;
 }
示例#4
0
        /// <summary>
        /// Converts the provided <see cref="SpecFlow.Background"/> instance into a <see cref="Augurk.Entities.Background"/> instance.
        /// </summary>
        /// <param name="background">The <see cref="SpecFlow.Background"/> instance that should be converted.</param>
        /// <returns>The converted <see cref="Augurk.Entities.Background"/> instance.</returns>
        public static Background ConvertToBackground(this SpecFlow.Background background)
        {
            if (background == null)
            {
                return(null);
            }

            return(new Background()
            {
                Title = background.Title,
                Keyword = background.Keyword,
                Steps = background.Steps.ConvertToSteps()
            });
        }
示例#5
0
 protected virtual void AppendBackgroundLine(Background background, StringBuilder result)
 {
     AppendNodeLine(result, background.FilePosition, "{0}: {1}", background.Keyword, background.Title);
     if (!string.IsNullOrEmpty(background.Description))
         AppendMulitLine(result, background.Description);
 }
    // $ANTLR end "descriptionLine"


    // $ANTLR start "background"
    // SpecFlowLangWalker.g:76:1: background returns [Background background] : ^( BACKGROUND (title_= text )? steps_= steps fp_= fileposition ) ;
    public Background background() // throws RecognitionException [1]
    {   
        Background background = default(Background);

        Text title_ = default(Text);

        ScenarioSteps steps_ = default(ScenarioSteps);

        FilePosition fp_ = default(FilePosition);


        try 
    	{
            // SpecFlowLangWalker.g:81:5: ( ^( BACKGROUND (title_= text )? steps_= steps fp_= fileposition ) )
            // SpecFlowLangWalker.g:82:3: ^( BACKGROUND (title_= text )? steps_= steps fp_= fileposition )
            {
            	Match(input,BACKGROUND,FOLLOW_BACKGROUND_in_background485); 

            	Match(input, Token.DOWN, null); 
            	// SpecFlowLangWalker.g:83:13: (title_= text )?
            	int alt7 = 2;
            	int LA7_0 = input.LA(1);

            	if ( (LA7_0 == TEXT) )
            	{
            	    alt7 = 1;
            	}
            	switch (alt7) 
            	{
            	    case 1 :
            	        // SpecFlowLangWalker.g:83:14: title_= text
            	        {
            	        	PushFollow(FOLLOW_text_in_background502);
            	        	title_ = text();
            	        	state.followingStackPointer--;


            	        }
            	        break;

            	}

            	PushFollow(FOLLOW_steps_in_background520);
            	steps_ = steps();
            	state.followingStackPointer--;

            	PushFollow(FOLLOW_fileposition_in_background536);
            	fp_ = fileposition();
            	state.followingStackPointer--;


            	Match(input, Token.UP, null); 

            }


                background =  new Background(title_, steps_);
                background.FilePosition = fp_;

        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return background;
    }