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

  • SEARCH
  • Home
  • 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 6979011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:49:53+00:00 2026-05-27T17:49:53+00:00

I have a client application which calls my WCF service (Security Token Service i.e.

  • 0

I have a client application which calls my WCF service (Security Token Service i.e. STS, to be precise) which authenticates the user. We have many applications integrated together and this specific WCF service (STS) in turn calls other web service of some third party application because my STS needs some details from the third party web service to proceed.

Now I want to write unit tests for my STS as well as for my client application login functionality.

My questions are:

  1. Shall I write unit test just for STS methods with some hard coded values as input from third party web service? If no, unit tests will fail if something goes wrong with the third party web service.

  2. Instead of calling my STS from unit tests of client application, can i hard code the input (e.g. username and password) values? Is it the right approach?

  3. Is it necessary to actually call the web service from unit tests written for client application? If yes, why?

  • 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-27T17:49:53+00:00Added an answer on May 27, 2026 at 5:49 pm

    A unit test does not cross process boundaries, integration tests do that. Your purpose is to test the behaviour of your STS only. In order to do so you need to inject a mock implementation of the 3rd party service. I suggest you look a MOQ. you may also need a DI container (I use ms unity, but are many to chose from) from which your STS will resolve a reference to the 3rd party service.

    • build 3rd party service mock and register in DI container
    • instantiate STS in process, no need to fire up WCF runtime
    • test STS and verify mock expectations
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a client server application in which I need to transmit a user
I have client application that uses WCF service to insert some data to backend
I have client-server application, where server side is Azure WCF service with data in
I have a WCF service with a client application. I have complete control over
I have Silverlight application which connects to a WCF service. If i open the
Lets suppose I have an .NET client application that connects to a WCF service,
I have a WCF client which passes Self-Tracking Entities to a WPF application built
I have a .net client application which is connected to a remote database. Is
I have a client server application in which the server and the client need
We have a Server/Client cybercafe management application which used to work fine on Windows

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.