xUnit Test generating Access Violation

Viewed 122

I use xUnit in my c# test frameworks under Visual Studio 2019. Occasionally I'll run into a situation where I've got a self-referencing loop in my code...but rather than throwing a stack overflow exception -- which is what I think the "right" exception is given we're talking infinite recursion here -- the test framework crashes with an access violation.

When I fix the self-referencing issue the test framework runs correctly.

My question is this: is there a way to configure VS 2019 so it detects the imminent exhaustion of memory (or even just "too many calls to the same method in too short a period of time") and throws a different exception? That would make it easier to figure out what code is causing the problem.

0 Answers
Related