I prefer unit tests using the direct window, mainly because it means that I can run the code over and over again very simply (and indeed from the build script).
If you find a problem using the direct window and fix it without adding any tests, you will not be warned if the same problem returns again. With unit test, you have a constant companion to make sure that any future changes do not return an error.
Personally, I don’t like going through the code - I find it disappointing compared to unit testing. It is too simple to accidentally step over something that you would like to intervene, etc. This is sometimes necessary, but often it is a sign that your code is too complex. I especially don't like debugging the whole application, and not just going through the unit test into the debugger. It is usually orders of magnitude slower.
source share