Occasionally I come accross a unit test that doesn’t Assert anything. The particular example I came across this morning was testing that a log file got written to when a condition was met. The assumption was that if no error was thrown the test passed.
I personally don’t have a problem with this, however it seems to be a bit of a ‘code smell’ to write a unit test that doesn’t have any assertions associated with it.
Just wondering what people’s views on this are?
This would be the official way to do it: