public class LocalhostServerFixture { private readonly MountebankClient _client; public MountebankServerFixture() { this._client = new MountebankClient(); } public string GetHealthCheckUrl(HttpStatusCode statusCode = HttpStatusCode.OK) { this._client.DeleteImposter(8080); var imposter = this._client .CreateHttpImposter(8080, statusCode.ToString()); imposter.AddStub() .OnPathAndMethodEqual("/api/ping", Method.Get) .ReturnsStatus(statusCode); this._client.Submit(imposter); return "http://localhost:7071/api/ping"; } }