Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 477007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:32:51+00:00 2026-05-13T00:32:51+00:00

I have a WCF server that is a library assembly. (I am writing it

  • 0

I have a WCF server that is a library assembly. (I am writing it so I can mock the level below it) It is called var a client helper class that is in a different assembly. As the data that is transferred is complex and the server has to send call-backs to the clients I wish to test the WCF code in isolation.

(I am only interested in the TCP channel or NamePipe channel)

I do not wish to mock WCF, as the risk I am trying to control is my usage of WCF.

It there a easy way to

  • Load my WCF server into a different app domain
    (I could load the WCF server into the main app domain, but then I it harder to prove that the objects were serialized correctly rather than just pointer moved about.)
  • Setup all the WCF config so the client class can call it (most likely named pipes or TCP)
  • And use it in some nunit test
  • I rather not have my unit tests depending on config file.

I expect (hope) that there are some util classes for setting up WCF unit test that I can just pass the type of my server class to and will give me back a client factory that connects to the server.

Am I going about this the wrong way, e.g there a better way of testing my communication layer and usage of WCF?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T00:32:52+00:00Added an answer on May 13, 2026 at 12:32 am

    It is by far the easiest approach if you spin up the service in-proc, because then you don’t need to write a lot of complex synchronization code to determine when the service is running and when it isn’t.

    Don’t worry about pointers being passed around – they won’t (unless you choose the new in-proc binding in WCF 4). It’s the binding that determines how and if objects are serialized. Named pipes are excellent for this purpose.

    I always spin up a new ServiceHost in each test case inside a using statement, which effectively guarantees that the host is running before calls are being made to it, and that it is properly closed after each test. This last part is important because it ensures test independence.

    You may also want to look at a series of blog posts I wrote about a very similar subject.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created WCF client/ server applications using calculator demo as mentioned in http://msdn.microsoft.com/en-us/library/ms734712.aspx
I have some WCF methods that are used to transmit information from a server
We have an application that starts a WCF server and the app reads from
I have WCF server and WCF client. When a new version of client is
I have a WCF service and a client, that uses a custom UserNamePasswordValidator for
I have a Silverlight 4 application that uses WCF services on the same server
I have a WCF server and I'm tapping into the Faulted event which stupidly
I've got a WCF service up and running on a server. We have a
I have a WCF service that I have to reference from a .net 2.0
I have a WCF Web Service which is referenced from a class library. After

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.