Displaying line numbers in unit test failure results

Hi,

I'm new to unit testing and have been experimenting with it over the last few days. I have been writing my tests in the test class generated by VS. I'm finding that it is easier to put multiple Assert statements into each test method (to fully test everything). Then, when one of my test methods fail I get a call stack but it doesn't show any line numbers. So I can't tell which assert statement caused the problem - I would prefer the stack to show line numbers rather than have to fill out the message parameter of the Assert statement (I'm lazy).

My understanding of line numbers is that the pdb files need to be available for line numbers to be displayed. From what I can see this is the case.

One related issue is that when an unexpected exception occurs in the class I am trying to test, I don't get line numbers from the call stack there either.

Thanks in advance,

Stephen

[906 byte] By [StephenArcher] at [2008-2-22]
# 1

There was a bug in beta2 that caused this not to work correctly. However, it has been fixed in more recent builds -- I think you should see it in the June CTP and definately the July CTP.

However, there is a workaround for beta2 - that is to add deployment items for your PDBs. This way they will be located with the DLLs and thus be picked up automatically.

Hope this helps.

dhoptonMSFT at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Performance Tools (Profiler)...

Visual Studio Team System

Site Classified