2
votes

enter image description here

enter image description here

Trying to use the Mountebank .Net Client for the test project

  _mbClient = new MountebankClient();
  _mbClient.DeleteAllImposters();

HttpRequestException: No connection could be made because the target machine actively refused it

1
Does it work sometimes? Normally this error means that the server exists but there is no endpoint listening. Is mountebank running behind a firewall?tom redfern
hi @tomredfern I have figured it out. I will post an answer to this. Thanks for your information.Franva

1 Answers

1
votes

It turns out that the MbDotNet doesn't have Mountebank integrated which makes sense.

I thought that I only need to install this Nuget package and it includes everything.

So the answer is: I need to go to the Mountbank website and install it, after that run

mb

to start the server, then run my Xunit .Net Core code, then the magic will happen.

If you would like a different url to host the MB server, then use its command line command to run it against different port and remember to pass in the new port number into your MountebankClient constructor.

That's it :)