Solved

unit testing in wcf

Posted on 2014-01-18
5
525 Views
Last Modified: 2014-02-09
Hi experts..

How can we do unit testing in wcf? if you can provide me an example..

will I be using wcf webservice url or wcf library dll in the test project?

thanks
meetDinesh
0
Comment
Question by:Dinesh Kumar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:deanvanrooyen
ID: 39792770
Hi meetDinesh,

your question is very open ended, wcf is a pipeline of different components, you could essentially write unit tests at any point that you might be writing your own code - you shouldnt be unit testing any of the framework code. The service initialisation in itself is difficult to unit test unless you are hosting it within a thirdparty e.g. ninject, because that entry point to inject dependencies into to initialisation constructor is hidden away if your not using a 'hosting' ioc library.

this is an old example using ioc
http://pieterderycke.wordpress.com/2011/05/09/using-an-ioc-container-to-create-wcf-service-instances/
0
 

Author Comment

by:Dinesh Kumar
ID: 39794375
Hi what do I think is we will be using the dll of the wcf library and using that to test its  methods in the test project. this test project can be made using microsoft visual studio.

will that n't be easy?
0
 
LVL 12

Expert Comment

by:deanvanrooyen
ID: 39794942
Best is just do it and see what issues arise...
0
 

Accepted Solution

by:
Dinesh Kumar earned 0 total points
ID: 39833296
Yes I tried the way I thought.. so unit testing a wcf service is easy as we just need to use the dll of the wcf library and use the namespace and classes of wcf in the unit test project.
0
 

Author Closing Comment

by:Dinesh Kumar
ID: 39845124
The solution I thought initially worked well on real project.
0

Featured Post

2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For some reason Google Apps has decided to reserve 'www' for your new domain which results in an error when trying to map the web address 'www' to a certain site in your Google Sites. The error is 'this address is already being used' and after some …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question