[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

unit testing in wcf

Posted on 2014-01-18
5
Medium Priority
?
539 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

649 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