Ignoring StoryQ step method naming with ReSharper

Sep 30, 2011 at 12:31 PM

Hi all

I've been using StoryQ for ages now and love it! My one gripe is that ReSharper keeps putting yellow wavy lines under my StoryQ step methods because they have underscores in them. Has anybody got around this in a way that doesn't stop ReSharper moaning about other, genuinely badly-named methods?


Sep 30, 2011 at 1:47 PM

If you can convince resharper that your file or region of code is "generated" code, it gets significantly more relaxed about naming conventions. Try it out by putting "#region Component Designer generated code" around your step methods.If your computer is rigged to self destruct if you every type "#region", you'll have to mark the whole file as generated (change its extension to .Generated.cs).

You can configure which region name / file extensions count as generated in resharper > options > code inspection > generated code.

Does that help?

Sep 30, 2011 at 2:35 PM

That's a bit drastic - I'd really like to keep everything switched on except for method name checks. I've previously relaxed the rules on test methods (when I used to use Given_When_Then() to name my tests) but there are - happily - no attributes that I can use to identify StoryQ methods.

Another option might be to use ReSharper comments to disable that specific check in the relevant places, but they're so ugly :/


Oct 3, 2011 at 7:50 AM


I too struggle with this. I did make some rules focusing on *Test.cs files but that it didn't work because it was still too general (and turned them off). I have found that I need a set of rules in my test project that are different from distributable (aka production) code. I also use lowercase for test helpers but can't restrict this rule only to the test library (and I don't want to use suffix or prefix on the file name).

Love resharper, they nicely provide licenses for this project too. Soooo I headed off to youtrack.jetbrains.net and I can't find a bug or feature request. I tried searches around Resharper product and "code inspection" and various other words like underline.

So I have put in a feature request here http://youtrack.jetbrains.net/issue/RSRP-276635

While you are there how about voting for this: http://youtrack.jetbrains.net/issue/RSRP-47805?projectKey=RSRP&query=code+inspection