Test-Driven Development Using NUnit and C# gives developers a one-day, practical introduction to the methodology and to NUnit on Microsoft .NET. The course is current to .NET 4.5.1 and Visual Studio 2013. The morning opens by asking what TDD actually is. It then separates functional and customer-facing tests from the narrower unit and programmer tests developers write against individual classes. From there, attendees look at test automation, simple design, and refactoring. They then take an NUnit test drive that puts the whole cycle together against real C# code. A closing module applies the same techniques to legacy code that was never written with tests in mind. Developers learn to catch and correct problems early by testing continuously.
The afternoon moves into NUnit fundamentals: the structure of a unit test and the NUnit framework itself. Students also learn the assertions, test cases, and test fixtures used to build out a suite. Students also work with test runners, learn to ignore tests selectively, and apply setup and teardown at both the test and fixture level. They then exercise their suite through the NUnit GUI tool and NUnit’s Visual Studio integration. A closing block on exceptions, debugging, custom asserts, and categories rounds things out. Students also revisit the NUnit console tool and take a second pass at refactoring once the suite is in place. The course stays practical throughout, with many example programs and a cumulative case study written in C#. Students receive a full set of materials, including course notes and all the programming examples.
Who Should Attend
Developers and Technical Managers
What Attendees Will Learn
Upon completing Test-Driven Development Using NUnit and C#, attendees will be able to:
- Explain the principles and practices of test-driven development
- Distinguish functional/customer tests from unit/programmer tests
- Apply simple design and refactoring techniques within a TDD workflow
- Develop fluency writing tests using the NUnit framework
- Use NUnit assertions, test cases, and test fixtures effectively
- Apply setup and teardown at the test and fixture level
- Exercise test suites using both the NUnit GUI and console tools
- Apply TDD techniques to legacy code
Prerequisites
The student should have a basic knowledge of the .NET Framework and experience programming in C# with Visual Studio.