rider: how to debug nunit single test in code

Answered

 

For ex, here is my code

[Test]
public void Test1()
{
Console.WriteLine($"p1");
Assert.True(true);
}

[Test]
public void Test2()
{
Console.WriteLine($"p2");
Assert.True(true);
}

How to debug Test2 in Debug tool win, but I find debugr c# unit test is very diff with debug java, debug ruby, it's like

so how to do this gif action in code? I find default "Debug Unit Tests" will run all test examples, I hope only run Test2

 

you use too much kotlin to write rider.jar, so I cannot set breakpoint in kotlin class(since they are all "compiled code"), it's hard to understand how rider.jar work

1 comment
Comment actions Permalink

Hi,

To run a single unit test please set the caret at the test/test class name, or anywhere inside its declaration in the editor, and use a shortcut for "Debug Unit Tests" action (Clrl+T+D on ReSharper keymap). Here you can find out more about running unit tests: https://www.jetbrains.com/help/rider/2017.1/Unit_Testing_in_Document.html

0

Please sign in to leave a comment.