Brian Genisio's House of Bilz

  Home  |   Contact  |   Syndication    |   Login
  60 Posts | 0 Stories | 111 Comments | 0 Trackbacks

News

Locations of visitors to this page

Archives

Post Categories

Who am I?

Shout it

When you are writing automated tests for your application, it is important that the tests do not rely on the file system or external services.  The only problem is that when you write applications using WCF, you are writing code that relies on external services.  It is very tempting to create service references in your test DLL and test against them, but please refrain.  There is a better way, I promise!

This series will focus on testing every part of your application -- including round-trip functional tests -- without employing the WCF framework directly.  We need to remember that the WCF framework is code that we do not control.  We need to trust that it does what it claims to and focus on our code directly.  In addition, the WCF framework is configurable via XML files, so we don't need to worry about having configuration working directly.  Writing tests for your code needs to be about your code, not the WCF framework.

So, let's look at the application that I am using in this series.  I have a WCF service named RecipeBoxService that stores and retrieves recipes.  The service is used as a back end for many possible clients: WinForms, ASP.NET, MVC, Silverlight, etc.  In this series, I will be writing a data mining application to demonstrate the testing techniques.

 RecipeBox

This post is just the introduction.  The actual parts will be laid out something like this:

  1. Testing the WCF service
  2. Testing the synchronous client
  3. Testing the asynchronous client
  4. Functional testing front-to-back
posted on Tuesday, November 18, 2008 11:13 PM

Feedback

# re: Testing WCF Service Apps (Part 0 of 4) 2/18/2009 8:34 PM Chris Hampson
Brian,

I also recommend using SoapUI's testing capabilities.

It has proved invaluable.

Chris

# re: Testing WCF Service Apps (Part 0 of 4) 2/18/2009 9:19 PM Brian Genisio
Chris,

This series is very different than what SoapUI can do. This series talks about testing the code, regardless of the transport layer. It talks about writing unit tests and functional tests without the need to actually host the service.

It includes client-side tests that rely on the services as well as the service tests.

Thanks for the link, though, as SoapUI is an alternative to the approach outlined in this series.

Brian

# re: Testing WCF Service Apps (Part 0 of 4) 5/16/2009 2:01 AM Alecza
Another alternative is WCFStorm (http://www.wcfstorm.com). Unlike soapUI it can handle WCF-specific bindings like netTcpBinding, wsHttpBinding etc. With SoapUI you can only use basicHttpBinding.

# re: Testing WCF Service Apps (Part 0 of 4) 5/16/2009 2:01 AM Alecza
Another alternative is WCFStorm (http://www.wcfstorm.com). Unlike soapUI it can handle WCF-specific bindings like netTcpBinding, wsHttpBinding etc. With SoapUI you can only use basicHttpBinding.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: