How do I run NUnit in debug mode from Visual Studio?

后端 未结 19 1325
闹比i
闹比i 2020-11-30 17:59

I\'ve recently been building a test framework for a bit of C# I\'ve been working on. I have NUnit set up and a new project within my workspace to test the component. All wor

19条回答
  •  暖寄归人
    2020-11-30 18:14

    Now with pictures:

    1. Run NUnit gui (Download 2.6.2 from here) then go to File -> Open Project

    1. Select your test .dll from bin folder (C:\......\[SolutionFolder][ProjectFolder]\bin\Debug\xxxxTests.dll)

    2. Go to Visual Studio Debug -> Attach to process (Attach to process window will open)

    3. From the list scroll down and select nunit-agent.exe then click Attach

    1. At this point breakpoints in your tests should turn ripe red (from hollow).

    2. Click Run on Nunit Gui and you should get your breakpoint hit...

    Hope this saves you some time.

提交回复
热议问题