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 6033931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:33:18+00:00 2026-05-23T05:33:18+00:00

Say we have a remote service Alpha, with a method GetUser(id, includePurchases). The method

  • 0

Say we have a remote service Alpha, with a method GetUser(id, includePurchases).
The method has this rule:

– If includePurchases is true, user.Purchases should have a list of Purchases.
– If not, user.Purchases should be blank.

Say we have a website Beta, with a UserRepository that has a method GetUser(id, includePurchases).
Beta.UserRepository.GetUser() calls Alpha.GetUser() internally.


The team responsible for Alpha says Beta should have a test that checks for that special rule.
I disagreed, because if you have a unit test that calls the service, that’s an integration test.

They don’t want the Beta test to call Alpha, but instead want a test that mocks the Alpha.GetUser method to include something like “if (includePurchases) user.Purchases = new List()”.
With that “if” in place, a test would be written that asserts user.Purchases is blank or not depending on the includePurchases flag.


Does this make sense to you?
The test they want, should that not be a concern solely for the Alpha unit tests?
To me, it seems like I’m writing a test that checks for an assumption about the way Alpha works.

  • 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-23T05:33:19+00:00Added an answer on May 23, 2026 at 5:33 am

    This sounds perfectly normal and legitimate from a componentization standpoint, and yes you are right, a Beta unit test that actuallys calls the Alpha service is an Integration Test.

    Remember that if you are writing unit tests for the functionality of Beta then you are responsible for Beta and Beta alone. It is appropriate and preferred to Mock the Alpha service call because your unit test should assume that these external dependencies work exactly as advertised.

    By mocking the functionality in Beta, you guarantee a repeatable and consistent unit test that verifies the functionality of ONLY Beta. In this way if the Beta process fails in the environment, and your unit test passes, then there must be a problem with the Alpha web service and then it is the other teams responsibility to address and fix this bug.

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

Sidebar

Related Questions

Say I have an ASMX web service, MyService. The service has a method, MyMethod.
Let's say I have remote interface A: @Remote public interface A { public Response
I have a a remote git repo and a local clone. Let's say I
i have problem use link_to_remote link_to_remote document example say link_to_remote Delete this post, :update
Lets say have this immutable record type: public class Record { public Record(int x,
Say we have the following method: private MyObject foo = new MyObject(); // and
I have this situation.... Client-initiated SOAP 1.1 communication between one server and let's say,
I have a WCF service ( Let's say WCFService1 ) is deployed on two
I have an executable that is started by a windows service, this program will
I am trying to debug a WCF service. This client has been able to

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.