So I have a method i'm unit testing via MSTests to ensure it throws an exception properly on bad data coming in.
However that method has Debug.Assert so it's caught while debugging if it happens during an actual test where I'm in debug mode trying to find a bug.
So the unit tests fail at being automatable when run in this way because the Assert statement comes up with Abort, Retry, Ignore. All 3 situations are important:
I'm debugging and looking for a problem, so I want the Debug.Assert to be available. The code should have the proper guard clause so if it happens in production an exception is thrown. My unit test should be completely automated and run without manual clicking.
What's the work around?