Unit testing in VSTS: Good and bad
Good:
- Configuration just works. I copied the would-be web.config to app.config in the test project and the tests had no problem getting data.
- No need to leave Visual Studio.
- Test attribute names changed from NUnit. Stupid. I can't think of a single good reason for this.
- Looking at the stack trace from a failed test doesn't let you click a code line number the way you do on a failed build to go right there. Right-click -> Go to source code sends you to the test code from the trace, which is almost never the real source of the error.
- The UI in the test explorer kind of blows. NUnits did this better. I tend to group my tests in a class that tests a class, and I like to be able to test just that test class. You can group the tests by class, but then there's no box to check for just that class.
- Assert.AreEqual fails. Expected: <1>, Actual: <1>. Huh?
- If there's a way to test in a Web context, I don't know how to do it. As per my last post, I don't know I can test to see if Server.MapPath("~/whatever") will work.
- If there's an obvious way to attach the debugger to the testing framework, that isn't obvious either.