SUMMARY

Integration tests are important to the quality of your application. Unit tests ensure that the individual components meet the business requirements as documented by the features and user stories. Integration tests ensure that these individual components work together correctly to create a functioning application.

When writing integration tests, you want to concentrate on the seams between the individual components in your application. In addition to the seams between the various internal components, you want to target the seams between your application and external resources such as databases, web services, file systems, and anything else that is not specifically a part of your application.

Like unit tests, integration tests expect to execute in an environment that is in a predictable state. Unlike unit tests, which rely on injected dependency objects and mocking to provide a stubbed environment, integration tests must use test versions of the actual external resources objects. As part of your integration test suite, you need to ensure that you are returning the test execution environment to a consistent state before the integration tests run.

Unit tests test the internal functioning of your application's individual components, and integration tests test the seams between the individual components of your application. End-to-end tests are a specialized type of integration test that verifies that the application code can execute entire business workflows based on the application's ...

Get Professional Test-Driven Development with C#: Developing Real World Applications with TDD now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.