How do I tell ReSharper that an attribute means that a method is used?

Posted by Roger Lipscombe on Stack Overflow See other posts from Stack Overflow or by Roger Lipscombe
Published on 2010-05-20T16:33:38Z Indexed on 2010/05/21 7:50 UTC
Read the original article Hit count: 303

Filed under:
|

I'm playing with SpecFlow, and ReSharper thinks that my step definitions are unused (I guess because they're used via reflection):

[Binding]
public class StepDefinitions
{
    // ...

    [When(@"I press add")]
    public void WhenIPressAdd()   // R# thinks this is unused
    {
        _calculator.PressAdd();
    }

    // ...
}

How can I tell ReSharper that methods with [Given], [When], [Then] attributes (etc.) are actually used? I don't want to use // ReSharper disable UnusedMember.Global comments.

© Stack Overflow or respective owner

Related posts about resharper

Related posts about resharper-5.0