我正在使用SpecFlow,但是ReSharper认为我的步骤定义未被使用(我猜测是因为它们是通过反射使用的):
[Binding]
public class StepDefinitions
{
// ...
[When(@"I press add")]
public void WhenIPressAdd() // R# thinks this is unused
{
_calculator.PressAdd();
}
// ...
}
我该如何告诉ReSharper方法使用了[Given]
、[When]
、[Then]
等属性?我不想使用// ReSharper disable UnusedMember.Global
注释。我也可以使用[JetBrains.Annotations.UsedImplicitly]
标记每个方法(或整个类),但我并不特别想这么做。