How do I write comments in a SpecFlow Feature?

Specflow

Specflow Problem Overview


I'd like to include some comments in a SpecFlow feature.

I get the the following error:

Custom tool error: Parsing error near '/*'

I've tried the following:

// comment
/* comment */
-- comment
' comment

How do I do this?

Specflow Solutions


Solution 1 - Specflow

As stated by sarfest above - its simply #-sign for comments.

There are no multiline comments but that's easily solved if you can do a vertical selection (hold down ALT-key and select in Visual Studio). Vertical select and the enter a #-sign.

Additional information: the line has to start with a #, and optionally any whitespace. This means you cannot combine comments with actual code on the same line.

Solution 2 - Specflow

also, if you want to perform multiline comments in an easy way (on visual studio),

you can select the lines to be commented, and hit CTRL+K+C to comment, CTRL+K+U to Uncomment.

Solution 3 - Specflow

thank you for the wonderful idea. I just need to press ALT and select the entire lines (just the little space which holds only one character space in each line) and then enter # which result from xyz abc to

'# xyz'

'# abc'

Solution 4 - Specflow

You can add comment lines to the feature files at any place starting the line with the # sign. Be careful however, as comments in the specification are often signs of wrongly specified acceptance criteria.

The comment lines are ignored by SpecFlow.

Categories

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKofi SarfoView Question on Stackoverflow
Solution 1 - SpecflowMarcus HammarbergView Answer on Stackoverflow
Solution 2 - SpecflowWasafa1View Answer on Stackoverflow
Solution 3 - SpecflowconfidentialView Answer on Stackoverflow
Solution 4 - SpecflowNirav MehtaView Answer on Stackoverflow