MOQ - verify exception was thrown

前端 未结 7 1872
暗喜
暗喜 2021-01-07 16:22

I working with MOQ framework for my testing. I have a scenario in which I expect a fault exception to be thrown. How can I verify it was thrown?

public void          


        
相关标签:
7条回答
  • 2021-01-07 17:11

    Ok so I solved it in the following way.

    Since the exception broke my test I put the method call in the Because block in try-catch.

    Then I could use a simple Verify.

    Thanks to all helpers...

    0 讨论(0)
提交回复
热议问题