public void SetUp() { var url = HostHelper.GenerateAHostUrlForAStubServerWith("endpoint"); TestContext.CurrentContext.SetCurrentHostUrl(url); TestContext.CurrentContext.SetCurrentHttpMock(HttpMockRepository.At(url)); }
public void Should_stubs_on_different_ports_each_time() { string expected = "expected response"; var hostUrl = HostHelper.GenerateAHostUrlForAStubServerWith("app"); HttpMockRepository.At(hostUrl) .Stub(x => x.Get("/app/endpoint")) .Return(expected) .OK(); WebClient wc = new WebClient(); Assert.That(wc.DownloadString(string.Format("{0}/endpoint", hostUrl)), Is.EqualTo(expected)); }
public void SetUp() { _endpointToHit = HostHelper.GenerateAHostUrlForAStubServerWith("endpoint"); _httpMockRepository = HttpMockRepository.At(_endpointToHit); }