Work Items


by DevilDog74
Sep 18, 2010
10:52 PM

Being evaluated

This is really more of a working sample on how to use WCFMock in the context of NUnit and Rhino Mock. My preferred testing tools are NUnit and RhinoMock, so this patch simply demonstrates how to use WCFMock with NUnit and RhinoMock.
I created a simple REST Service that returns a single person object as XML. The key things being demonstrated here are how to set values on WebOperationContext, OutgoingResponse, and IncomingRequest using RhinoMock
Patch Notes:
• Upgraded the solution to VS2010 format
• Upgraded all projects to compile against .NET 4.0
• Added a real RESTful WCF Service Implementation called SampleWCFService
• Added a test project for SampleWcfService named SampleWcfService.Test.Nunit
If you compile and start the Person.svc you can issue the following request in fiddler:
GET /Person.svc/firstName/joe/lastName/bloggs HTTP/1.1
User-Agent: Fiddler
Content-Type: application/xml
Authorization: someauthorization_string

Issuing the request above should return these results…
HTTP/1.1 200 OK
Server: ASP.NET Development Server/
Date: Sat, 18 Sep 2010 21:49:14 GMT
X-AspNet-Version: 4.0.30319
Content-Length: 223
Cache-Control: private
Content-Type: application/xml; charset=utf-8
Connection: Close

<PersonData xmlns="" xmlns:i=""><Email></Email><FirstName>joe</FirstName><LastName>bloggs</LastName><Phone>111-222-3333</Phone></PersonData>



View All
  • 1-1 of 1 Patches
    • Previous
    • 1
    • Next
    • Showing
    • All
    • Patches