Problem setting Breakpoint in Unit Test

J

joecool1969

I have a project I am writing unit tests for and I am having a problem
with one of the tests. I set a break point at the beginning of the
test and found which statement was causing the problem. I need to run
the test again so I can step into the offending statement instead of
over it, but the test run now refuses to stop on the break point! What
gives??
 
M

Morten Wennevik [C# MVP]

I have a project I am writing unit tests for and I am having a problem
with one of the tests. I set a break point at the beginning of the
test and found which statement was causing the problem. I need to run
the test again so I can step into the offending statement instead of
over it, but the test run now refuses to stop on the break point! What
gives??

Hi Joe,

This isn't really a C# question, but I'll try anyway. If you are using MS
Test for unit testing I assume you have tried to run the unit test in
'debug'. Every so often it will become out of sync. If you debug directly
from the test results pane you may then notice the "Run all tests" and "Debug
all tests" buttons have their icon slightly changed. If so try restarting
the test from code or from the Test List Editor.
 
R

Roger Pearse

I'm having the same problem - my breakpoints are not being picked up. It sounds as if this is a VS bug.

I didn't understand the reply. How do I get this to work?



MortenWennevi wrote:

RE: Problem setting Breakpoint in Unit Test
24-Mar-09


Hi Joe

This isn't really a C# question, but I'll try anyway. If you are using MS
Test for unit testing I assume you have tried to run the unit test in
'debug'. Every so often it will become out of sync. If you debug directly
from the test results pane you may then notice the "Run all tests" and "Debug
all tests" buttons have their icon slightly changed. If so try restarting
the test from code or from the Test List Editor

--
Happy Coding
Morten Wennevik [C# MVP]

Previous Posts In This Thread:

On 24 March 2009 02:24
MortenWennevi wrote:

RE: Problem setting Breakpoint in Unit Test

Hi Joe

This isn't really a C# question, but I'll try anyway. If you are using MS
Test for unit testing I assume you have tried to run the unit test in
'debug'. Every so often it will become out of sync. If you debug directly
from the test results pane you may then notice the "Run all tests" and "Debug
all tests" buttons have their icon slightly changed. If so try restarting
the test from code or from the Test List Editor

--
Happy Coding
Morten Wennevik [C# MVP]

On 25 March 2009 23:01
joecool196 wrote:

Problem setting Breakpoint in Unit Test
I have a project I am writing unit tests for and I am having a proble
with one of the tests. I set a break point at the beginning of th
test and found which statement was causing the problem. I need to ru
the test again so I can step into the offending statement instead o
over it, but the test run now refuses to stop on the break point! Wha
gives??

EggHeadCafe - Software Developer Portal of Choice
ASP.NET DropDown ListBox and XML Databinding
http://www.eggheadcafe.com/tutorial...61e-ab9d60b5f699/aspnet-dropdown-listbox.aspx
 
R

Roger Pearse

Roger Pearsewrote:


Well, did you do a Build -- Clean Solution?

First thing I tried...

Interestingly I couldn't get it to happen reliably. I tried
generating a noddy solution, and that all worked fine. But I'm
working with a sprawling legacy app, and it worked sometimes and not
others.
 
F

Felix Goller

Roger said:
First thing I tried...

Interestingly I couldn't get it to happen reliably. I tried
generating a noddy solution, and that all worked fine. But I'm
working with a sprawling legacy app, and it worked sometimes and not
others.

Ensure that you have not enabled the "optmize code" option. This was my
mistake when I had the same problem with Sharp Develop.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top