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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:30:27+00:00 2026-06-18T16:30:27+00:00

I am trying to do some unit testing in for a Web API project.

  • 0

I am trying to do some unit testing in for a Web API project. I am going simulate the web API hosting environment. It seems like that I could use In memory host (HttpServer) or self host (HttpSelfHostServer).

Just wondering what are the difference and which technology is good for what and is there any limitation for those options.

  • 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-06-18T16:30:29+00:00Added an answer on June 18, 2026 at 4:30 pm

    You should use in memory host for end-to-end tests and then test the network connectivity of your environment separately.

    For a number of reasons:

    • In memory host, as the name suggests, runs entirely in memory so will be much faster

    • Self host needs to be run with elevated privileges, so your tests will need to be executed within the context of an “admin” identity. This is far from desired. It is especially troublesome if you want to execute tests from i.e. build scripts or from PowerShell, since, as a result, these processes would also have to be started with elevated privileges. Moreover, this will have to happen on any of the servers you test on.

    • In self host you end up testing the given operating system’s networking stack which really is something that shouldn’t be tested – since it might differ across different environments (development, staging, QA, production and so on). For example – a given port might not be available. As a result you might get dragged into unnecessary debugging efforts across different machines to even get the tests running.

    • Finally, testing using self-hosting, still doesn’t guarantee that the service will run correctly when web-hosted and vice versa – so you might as well just test in memory

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

Sidebar

Related Questions

I'm trying to do some unit testing on a project that unfortunately has high
I am trying to implement some unit testing for an old framework. I am
All, I'm trying to do some unit testing in some archaic java code (no
I am trying to learn unit testing. I am trying to unit test some
Im trying to write some unit tests for a couple of merthods that are
I'm getting started with unit testing and trying to do some TDD. I've read
I am trying to write some unit tests for testing my service layer which
I am new to unit testing and I am trying to test some of
I'm trying to set up some unit tests for an XNA project. After some
Im using the Prism/Composite Application Library and trying to unit test some code that

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.