Solved

unit testing in wcf

Posted on 2014-01-18
5
520 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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 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