views:

75

answers:

2

How can I debug a specific rowtest?

I'm using Visual Studio and nUnit. TDD.NET addon is great but it doesn't let me to debug a specific rowtest, before coming to my test I have to go through all previous tests.

I know there are some commercial solutions for this. I'm looking for a free (or really cheap) solution.

    <RowTest()> _
    <Row("x")> _
    <Row("y")> _
    <Row("z")> _
    Public Sub TEst(ByVal fileToParse As String)
...
End Sub

In this case to able to test Row("z") I have to go through "x" and "y" and I've got some tests with 10+ rows.

2 not good enough solutions :

  • Using conditional breakpoints as a work around.
  • Launching debug mode with nUnit and running that rowtest from the nUnit GUI. But this takes quite a bit time, and sometimes I don't want to make my unit test DLL as startup project.
A: 

Well a dirty solution would be to comment-out all the other rows, and then debug :).

Or put an if statement in code which checks for the fileToParse parameter's value (let's say "y") and put a breakpoint inside (C# code):

 if (fileToParse == "y")
 {
    int a = 0; a++;
 }
Igor Brejc
A: 

I end up with launching nUnit in Debug and double clicking the row.

dr. evil