Tag: expected exception

我如何获得SpecFlow预期exception?

我正在使用SpecFlow,我想编写一个如下所示的场景: Scenario: Pressing add with an empty stack throws an exception Given I have entered nothing into the calculator When I press add Then it should throw an exception 这是calculator.Add()这将抛出一个exception,所以我如何处理标记为[Then]的方法?