How to do proper unit tests