我正在玩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]
。我也不是特别想这样做。