Integrating NUnitTesting GUI to Visual studio 2012 and debugging Test Cases

為{幸葍}努か 提交于 2019-12-20 03:50:58

问题


I am using NUnit 2.5 as my unit testing framework for visual studio 2012 professional. I configured NUnit.exe to open NUnit GUI for testing my dlls.

I am testing a dll called "BookStore.dll" which i generated by compiling my current class library project "BookStore"

To configure nunit as my testing framework i set the following values in the BookStore library project properties window:

Start External program: C:\Nunit\Nunit.exe

Command line arguments : BookStore.dll

working directory as : C:\Projects\BookStore\Bin\Debug\

i set the following configuration value in the nunit.exe.config

under configuration tag:

 <startup>
    <supportedRuntime version="v4.0" />
  </startup>

under runtime tag:

 <loadFromRemoteSources enabled="true" />

Now i set the start project as this library project and hit F5. NUnit opens and i am able to select the project and test methods and i am able to hit run and see all the test results.

So far so good:

but the problem is when i put a break point in any of the test method in the BookStore project, that break point is not hitting.

Can anybody help me what am i missing here.?

Note: i configured this unit testing using this blog: http://blog.toddbauer.me/2011/02/17/debugging-net-nunit-tests-in-visual-studio/


回答1:


Instead of directly hitting F5 and running the Test Project, I tried to run the project as this:

  1. Put a breakpoint where ever needed.
  2. Right click the Test project -> Debug -> Start new instance.

and then when i choose that appropriate test method and hit run, that enabled me to hit the breakpoint.

It works now.



来源:https://stackoverflow.com/questions/13196712/integrating-nunittesting-gui-to-visual-studio-2012-and-debugging-test-cases

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!