Solved

unit testing in wcf

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now