Hi all I’m making a Chess AI as hobby project with Test Driven Development. But for some reason the only message my tests give is “test has thrown an exception: …”. And therefore omitting the only thing that matters. Instead of directly reading the error I now have to right-click and view test result details. I have tried adding and removing columns, but I cannot get the whole message to be shown directly.
Can VS2010 be setup so the exception message gets shown directly for each unit test?
edit: I am using standaard VS unit tests:
[TestClass]
public class MiniMaxTest
{
[TestMethod]
public void TestConstructor()
{
throw new Exception("Must I click view details to see this?");
}
}
Why these questions? You guys can reproduce these things. Debug or Run tests give the same messages:

No, I don’t believe you can configure VS to show it differently. The IDE shows the first line of the exception message, and there’s a newline character in the full message text, so you’ll need to click through to the details to view the whole thing.
What you can do however, is abuse the MSTest framework to show your own messages.
MS Test Assertions are all implemented by throwing exceptions. All the MS Test
Assertfunctions throw exceptions which are derived fromUnitTestAssertException. Visual studio has special handling for these kinds of exceptions.For example: If you write this test:
AssertFailedExceptionis the standard base class for most other assertion failures.You’ll note that VS2010 does not print the generic “test threw an exception” message, instead it just prints “Failboat”.
Now what you can do is surround your tests in things that convert normal exceptions into
AssertFailedExceptionand then you can print whatever messages you like.Of course, I wouldn’t recommend actually doing this… it’s verbose, and more importantly, you lose the call stack… but hey, now you’ve got one more tool in your toolbelt