Debugging Nunit Tests breaks in the Nunit "Assert.cs"

Answered

I run debug on complicated unit tests in an attempt to find out why they're failing.

I've set Rider to break on Unit.Framework.AssertException, and Unit.Framework.MultipleAssertException.

I've checked "Just my code"

however Rider goes past the failed assert in my code and stops in the Nunit code, forcing me to switch to the debugger frame stack view and select where I really wanted it to break.

Is this normal? is there a way to 'fix' this behavior?

 

3 comments
Comment actions Permalink

Hi! Could you please try to disable the Break on user-unhandled exceptions (.NET/.NET Core only) option on the `File | Settings | Build, Execution, Deployment | Debugger`? Let me know if it helps.

Anyway, we are going to improve this functionality in the next release: RIDER-24651

0
Comment actions Permalink

Hi,

Yes disabling that does appear to work.

I'm not sure I noticed these settings here when I was trying to do this originally,

Maybe it might be worth considering putting the "Break points" settings into a node in the settings tree under debugger, and have the "View Break points" button open the settings at that node? 

That would put it all in a similar place, currently it feels a bit like there's settings for the same thing in two different places.

Thanks,

Jon.

 

0
Comment actions Permalink

Jon, 

We're going to change the logic (and probably UI) here in the next release. Thank you for your suggestions. 

0

Please sign in to leave a comment.