How Can I Debug a Specific Rowtest?
-
22-08-2019 - |
Question
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.
Solution 2
I end up with launching nUnit in Debug and double clicking the row.
OTHER TIPS
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++;
}