The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Debugging Unit tests using the VS.net debugger

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Roy Osherove

Posts: 1807
Nickname: royo
Registered: Sep, 2003

Roy Osherove is a .Net consultant based in Israel
Debugging Unit tests using the VS.net debugger Posted: Jan 9, 2004 10:03 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Roy Osherove.
Original Post: Debugging Unit tests using the VS.net debugger
Feed Title: ISerializable
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/rosherove/Rss.aspx
Feed Description: Roy Osherove's persistent thoughts
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Roy Osherove
Latest Posts From ISerializable

Advertisement

Here's a very easy way to debug your unit tests line by line using the vs.net debugger (you shouldn't need to do this too often if you're doing Test Driven Development correctly though):

  • Set the testing project as the startup project in the solution(so you can start debug with F5)
  • Open the project properties of the project with all the tests
  • In the Configuration Properties->Debugging , set the "start action" to "start external program" and select the Nunit-gui.exe or the Nunit-console.exe
  • If you selected the console program, put the name of your assembly in the parameters to send to this program

That's it. Now, to start debugging:

  • Place a breakpoint anywhere in the code that will be tested (either a test or a code that is used by the test)
  • Hit F5.
  • If you chose to debug using the Nunit gui application, just hit "run" on the tests you want and let the debugger stop at the breakpoint you want.If you are debugging by starting the console application you will get to that breakpoint automatically eventually (all the tests in the assembly will be run).

 

Find out more in this article

Read: Debugging Unit tests using the VS.net debugger

Topic: New and Notable 33 Previous Topic   Next Topic Topic: For Dubliners and Irish Longhorn Preview

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use