O'Reilly logo

Professional Test-Driven Development with C#: Developing Real World Applications with TDD by Jeff McWherter, James Bender

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

8

Integration Testing

WHAT'S IN THIS CHAPTER?

  • How integration tests are different from unit tests and why integration tests are important
  • Why it's important to start writing and running integration tests early
  • How to write an automated integration test with NUnit and where the practice deviates from writing unit tests with NUnit
  • What end-to-end tests are and why they are critical to the success of an application development effort
  • How to manage the external resources that are used by integration and end-to-end tests
  • When and how integration and end-to-end tests should be run

The point of unit tests in TDD is to drive the development of discrete components and sections of an application. To that end, it's important to keep the unit tests and the code they exercise isolated from other components or external resources. In fact, tests that test the same unit of functionality should be isolated from each other. This means that these tests can be run in any order or combination and produce the same predictable results. This is necessary to ensure that the application's individual components are being developed in a simple, loosely coupled, and complete manner. The isolation of unit tests also makes it easier to diagnose and correct defects that cause tests to fail.

There comes a time, however, when an application's components must be combined. Ensuring that these various parts come together correctly is the job of integration tests. Integration tests verify that the various components ...

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

Start Free Trial

No credit card required