Q:

Can we have a Unit test project dedicated only to WCF in Visual Studios 2013?

Just wanted to know whether we can have a Unit Test Project dedicated to a WCF Solution or not ? I know this might be a Generic question but I couldn't get specific answer to it even though I searched through various blogs and websites. Please suggest.

A:

yes its possible to unit test WCF services. The options are:

create classes which do all of the work which are separate from the WCF service. Unit test these classes in isolation. Make your service a thin wrapper which calls these classes. 
test directly with the WCF service class without it being hosted (a bit like this example)
Have the unit tests host the WCF service in process and then call the services via named pipes or similar (see the console example here for details of how to self-host). When you self host you should start the service in the test setup or the test fixture setup and then destroy it in the corresponding teardown.

