
26 Jan
2010
26 Jan
'10
4:15 p.m.
Rob Stewart wrote:
Doing so avoids the mess that ensues when trying to unit test classes and functions that use supposed singletons/global state.
I can't argue with that. It is also easier to unit test functions returning error codes, but that shouldn't be the only factor in design.
??? A try/catch block may not be beautiful, but calling it a mess like trying to unit test a side-effect full function doesn't seem appropriate. Regards, Thomas