4 ms·
> If you can write a unit test that makes your code throw UnreachableException, you almost certainly should be throwing a different exception. ArgumentNullExce
by gwbas1c 4y ago
> If you can write a unit test that makes your code throw UnreachableException, you almost certainly should be throwing a different exception.
ArgumentNullException, InvalidOperationException... There's plenty that have been around since the beginning.
What's more important, that I didn't see in the first two examples, are useful error messages.
- aloisdg 4y ago`ArgumentNullException` was my first idea too. I would and did use it for this kind of purpose.