Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8091947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:10:55+00:00 2026-06-05T20:10:55+00:00

Hi all I’m making a Chess AI as hobby project with Test Driven Development.

  • 0

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:
exception message remains hidden

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:10:56+00:00Added an answer on June 5, 2026 at 8:10 pm

    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 Assert functions throw exceptions which are derived from UnitTestAssertException. Visual studio has special handling for these kinds of exceptions.

    For example: If you write this test:

    [TestMethod]
    public void AllAboard()
    {
        throw new AssertFailedException("Failboat");
    }
    

    AssertFailedException is 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 AssertFailedException and then you can print whatever messages you like.

    [TestMethod]
    public void TestStuff()
    {
        try
        {
            string o = null; // pretend this came from some real code
            var x = o.Split(new[] { ',' }); // this will throw NullRefException
        }
        catch (Exception e)
        {
            throw new AssertFailedException(e.Message, e);
        }
    }
    

    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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All, I'm using wordpress with this and for some reason the eventDrop stopped working.
all. We're trying to get some intersect collisions working, but the problem experience is
All, I have some script tags that are not working in Wordpress. If I
all I want to calculate the height of the page ,and in my test.less
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
All, In my Lex file we recognize some operators as Tokens some of this
All of a sudden the graph api only seems to be returning old posts.
all, I am trying to multiply a matrix to a vector in OpenGL, but
All, I'm trying to split my MSTest test run into multiple runs because I'm
All I know about the constraint is it's name ( SYS_C003415 ), but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.