O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

NUnit Pocket Reference

Book Description

Few .NET developers have the luxury of unlimited code testing once their application is complete, and rushing through the testing process is both problematic and stressful. The open source NUnit framework provides an excellent and efficient way to test and improve .NET code as it's written, saving hundreds of QA hours and headaches.NUnit is one of the most mature and widely-used .NET open source projects even Microsoft uses it internally. NUnit is a unit-testing framework for all .Net languages. Written entirely in C#, NUnit takes advantage of many .NET language features, such as custom attributes and other reflection related capabilities. It automates unit testing and reduces the effort required to frequently test code while developing it. NUint is invaluable for .NET developers in test-driven development under agile methodologies such as Extreme Programming (XP) as well as for developers who use for unit testing for software quality assurance. Unfortunately, some of those valuable hours saved by using NUnit can be wasted trying to master this powerful but under-documented frameworkProof that good things come in small packages, the NUnit Pocket Reference is a complete reference to NUnit, filling in the blanks left by the existing documentation and online discussion. It offers developers everything they need to know to install, configure, and use NUnit; the NUnit user interface; and a reference to the NUnit framework classes in a slim but well-organized package. This handy little book even offers practical, real world NUnit examples. And with the NUnit Pocket Reference, IT managers will know to expect when they implement unit testing in their projects. It is the only book you'll need on this popular and practical new open source framework.

Table of Contents

  1. 1. NUnit Pocket Reference
    1. Introduction
    2. Conventions Used in This Book
    3. Using Code Examples
    4. Acknowledgments
    5. Unit Testing
      1. Testing Software
      2. What Is Unit Testing and Where Did It Come from?
      3. Test-Driven Development
      4. Test Harness
      5. Unit Test Design and Development Overview
      6. Best Practices for Unit Testing
    6. What Is NUnit?
      1. How Does NUnit Work?
    7. Setting Up NUnit
      1. Prerequisites
      2. Programming Languages
      3. Getting NUnit
      4. Installing NUnit
      5. Configuring NUnit
      6. Manual Installation
      7. Navigating the Source Code
    8. Unit Testing with NUnit
      1. Unit Testing with NUnit
        1. Test cases
        2. Test fixtures
      2. Creating a Test
      3. Running a Test
      4. Assertions
        1. Custom assertions
      5. Other Testing Elements
        1. Setting up and tearing down
        2. Testing expected exceptions
        3. Ignoring tests
        4. Test categories
        5. Test suites
        6. Limitations
    9. Test Runner GUI
      1. User Interface
        1. Test tree view
        2. Progress bar
        3. Test results
        4. Status bar
      2. NUnit Projects
        1. The Project Editor dialog
        2. Selecting, Adding, and Editing Configurations
        3. The Options dialog
        4. Opening Visual Studio projects
        5. Opening Visual Studio solutions
        6. Adding Visual Studio projects
      3. Running Tests
        1. Debugging from the Visual Studio .NET IDE
        2. Results in XML format
      4. Running the Test Runner GUI from the Command Line
        1. Testing an assembly
    10. Test Runner Console
    11. Debugging with NUnit
    12. Testing with Mock Objects
    13. Compatibility
      1. Using NUnit 2.1 Tests with NUnit 2.2
      2. Using NUnit 2.0 Tests with NUnit 2.2
      3. Upgrading from NUnit 1.x to 2.2
      4. Changes from NUnit 2.1 to 2.2
      5. Changes from NUnit 2.0 to 2.1
    14. Extending NUnit
      1. Integrating NUnit with Visual Studio .NET
      2. NUnit AddIn for Visual Studio .NET
      3. VSNUnit
      4. NUnitAsp
      5. NCover
      6. NAnt
      7. Nantpad
  2. Index
  3. About the Author
  4. Copyright