10

Testing Windows Communication Foundation Services

WHAT'S IN THIS CHAPTER?

  • Understanding why Windows Communication Foundation (WCF) services are an important part of your application
  • Recognizing WCF services as interface code, similar to a Windows form or web page
  • Refactoring your WCF services to employ dependency injection
  • Understanding the role that transports play in testing WCF services

Like web pages or desktop windows, services are an interface to your application. As with the other interfaces to your application, your application's services need to be tested to ensure that they meet all the requirements that have been specified for them as an interface to your application. Testing services is especially necessary, because unlike Windows forms or web pages, errors and defects can be easily obfuscated or swallowed by a services layer in ways that make diagnosing defects extremely difficult.

WCF is the standard framework for creating services in .NET. However, many developers are intimidated by even the basics of WCF. As a result, even developers who are willing to learn WCF find testing services to be a daunting proposition. The skills to properly test WCF services are not difficult to learn. This chapter provides you with the tools and knowledge you need to test your WCF services.

imagesThis chapter assumes a basic level of knowledge and skill with WCF. If you are unfamiliar ...

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.