4 ms·
I don't usually have code that tests arguments and raise exceptions, in my code and in my customers code. As those code paths don't exist, we are not writing th
by pmontra 4y ago
I don't usually have code that tests arguments and raise exceptions, in my code and in my customers code. As those code paths don't exist, we are not writing those tests.
If a method accepts only values >= 0 (eg, square root) we test that we handle negative numbers as the documentation of the API says. That should be the same in C++.
When we refactor the implementation of a web app endpoint we only test that the request still yields the response. Apparently this approach worked well enough.
If somebody sends a foo instead of bar, baz or quux they'll get a 500 with the error message in the documentation and that's it.