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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:44:22+00:00 2026-05-26T07:44:22+00:00

I need to change my unit test from local to remote tests and so

  • 0

I need to change my unit test from local to remote tests and so far I thought that all I had to do is change UrlToTest to point to another server… But VS keeps on insisting to create a Development Web Server instead of using the one that is already running.

So after reading some docs my question actually is do I have install Test Controller and Test Agent on both remote and local computer or what? What if the WebService is on Linux…

Note that I don’t want to debug the application that I’m testing. I simply want tests to be executed for a WebService that is already running, that is deployed.

I probably should mention that all my tests consists of WebService calls and some checks like this:

    [TestMethod()]
    [HostType("ASP.NET")]
    [AspNetDevelopmentServerHost("MainProjectName", "/")]
    [UrlToTest("http://servername:port/websitename/TestingOnlyWebForm.aspx")]
    public void LoginEmptyDataTest()
    {
        IUserService userService = CreateIUserService();
        string email = "";
        string password = "";
        ReturnMessage<User> actual;
        actual = userService.Login(email, password);
        Assert.AreNotEqual(true, actual.Status);
        Assert.AreNotEqual("db_error", actual.Info);
    }

But I have also more complicated tests in which I change some data and send it to another WebService and so on.

Note that UrlToTest previously was pointing to localhost at which point it works but starts a developer server which is not what I want.

  • 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-26T07:44:23+00:00Added an answer on May 26, 2026 at 7:44 am

    What you are trying to is not possible. All that generated unit test is trying to do is to run the test locally on the machine either using the development server by specifying AspNetDevelopmentServerHost or by using local IIS, when AspNetDevelopmentServerHost is not present.

    If you want to test remote services right click your unit test project and add a service reference. Point to your service give it a namespace, say Services, and generate the proxies. Once you have the proxies generated just instantiate them and call the methods. Also remove all the unneeded attributes from your test. Your test should roughly look like this:

         [TestMethod]
            public void LoginEmptyDataTest()
            {
                using (var userServiceClient = new Services.UserServiceClient(
                                            "BasicHttpBinding_IUserService", 
                                            "http://someremotehost/userservice.svc"))
                {
                    var result = userServiceClient.Login("user", "password");
    
                    // asserts go here
                }
            }
    

    This may solve your immediate problem however you should re-think what you are doing as @eglasius said. what happens if the code you call changes state internally? Next test might fail because of that so you need clean-up strategies otherwise your tests will be very brittle and you’ll end up ignoring them.

    Update: passing an address at run-time. Change the first parameter to whatever enpoint configuration name you have in your config file.

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

Sidebar

Related Questions

I need change background of all text that have two spaces from the start
I need to change what rows are grabbed from the database based upon a
I have written an application that unit tests our hardware via a internet browser.
Greetings, I want to write a unit test to make sure that our web
How do you unit test your code that utilizes stored procedure calls? In my
I need a unit test to make sure I am accumulating vacation hours properly.
I've created a control derived from ComboBox, and wish to unit test its behaviour.
One of my unit tests is driven by test data, stored in src/test/resources/testData.txt .
I have some Web API methods that I want to write unit tests for.
I'm trying to write a unit test for my FileWatcher class. FileWatcher derives from

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.