Testing Exceptions Using SenTestingKit / OCUnit

The only solution I seem to be able to find for testing for exceptions is to use SenTestingKit STAssertThrows and STAssertThrowsSpecific, however in both cases when the exception is thrown, the test application freezes until I ask it to continue. Of course, exceptions should be swallowed by the testing framework? And if not, does anyone have a suggestion for testing exceptions?

+6
source share
1 answer

I was going to remove this question, but here is a solution for everyone who ended up in the same situation:

The reason the application crashed was because I had an exception point configured. This is interrupted as soon as an exception occurs, and not when it bubbles up, so it actually stopped before it even reached my point. I just need to disable breakpoints (or just an exception breakpoint) when I run the tests.

enter image description here

+5
source

Source: https://habr.com/ru/post/898214/


All Articles