CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Paul Laudeman

Helping You to Make "Smart Clients" Smarter!

March 2004 - Posts

  • NUnit Tip: Debugging your unit tests

    I had a request from a coworker today who wanted to be able to step through a suite of unit tests to see the flow of the tests and examine the variables along the way. We are using the NUnit GUI and not any of the other types of addins for Visual Studio .NET (2002 or 2003), but the following instructions should apply with any other tool as well:

    1. To start the debugging, select a line of code in your unit test method and place a breakpoint on it.
    2. Launch the NUnit GUI (if not already running)
    3. In VS.NET, go to your Debug menu and select Processes.
    4. Find the running process for NUnit (“nunit-gui.exe”) and click “Attach”
    5. Select the “Common Language Runtime” as the program type you wish to debug and hit “OK”.
    6. Switch back to NUnit, select the test fixture where you placed your breakpoint, and click “Run” to start the test.
    7. VS.NET should automatically break on the line of code where you attached your breakpoint, and then you can step through your code like you would in a normal debugging session.

    Ideally, if you follow the spirit of unit testing you will not have the need to do this very often. However, if you are trying to see the flow of an aggregate of tests, this can be a very useful tool to see the flow without resorting to outputting statements to your console window or trace listeners.

    Learning to use the debugger to attach to running processes is a very powerful feature. Additional uses include debugging user controls during design time, attaching to code running on remote machines, and debugging serviced components. If there is any interest from the community, I can put together a more complete guide for this useful feature of VS.NET.

    Technorati Tags: ,  

  • VS.NET Service Packs to be released in the XP SP2 timeframe

    From Microsoft Watch, “Microsoft is planning to "service" its 2002 and 2003 versions of the .Net Framework and Visual Studio tool suite in order to insure they will work properly with Windows XP Service Pack (SP) 2.”

    Does anyone from Microsoft happen to know if these service packs will also include bug fixes for the IDE and Framework in addition to the new support for the XP SP2 security model changes?

  • Finally! Smart Client Offline Application Block released

    In an previous posting, I described some of the issues and challenges surrounding adding offline support to smart client applciations. Microsoft's Patterns and Practices Group announces the release of the Smart Client Offline Application Block to help you solve some of these issues in by using a “blue brick” to help ensure predictable and reliable results with your development efforts.

    This application block incorporates many of the concepts and code that originally appeared in the Northwind Unplugged sample:

    • Ability to detect network connectivity
    • Cache application data for offline use
    • Synchronize application data when network connectivity is restored

    For more application blocks, be sure to check the Patterns and Practices website.

More Posts