title: Unit testing a WCF service
body: <p>I'm designing an enterprise level web app that will have a Data layer + SQL database, a WCF REST web service layer that communicates with the data layer, then an MVC website which will communicate to the WCF REST web services. I want to have automatic unit testing at each level of the design.</p>
  
  <p>I have created a data layer unit test project fine, which tests the EF models, repositories, operations etc and have about 15 tests I can click a button for and run which so far, tests all the functionality the data layer provides.</p>
  
  <p>I want to have the same at the WCF service layer but I cannot figure out how to have an automatic test project to run against a WCF service. I've seen articles on using WCF test client to load the service in the background and be able to input parameters to each service method and see results, but I don't want a manual process, I want it to be automated, to mock the data layer and test the service calls in isolation. Complicated by the fact that ideally I would like to test the RESTful side of it, so being able to simulate GET/POST/PUT/DELETE etc and also to call certain methods with the wrong method and to confirm it fails as expected and so forth.</p>
  
  <p>Is there a good solution to do this automatically or am I approaching this wrong?</p>