public void SetUp() { var hostUrl = HostHelper.GenerateAHostUrlForAStubServer(); TestContext.CurrentContext.SetCurrentHostUrl(hostUrl); var endpointToHit = hostUrl + "/endpoint"; TestContext.CurrentContext.SetCurrentEndpointToHit(endpointToHit); TestContext.CurrentContext.SetCurrentHttpMock(HttpMockRepository.At(hostUrl)); }
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() { var hostUrl = HostHelper.GenerateAHostUrlForAStubServer(); _endpointToHit = hostUrl + "/endpoint"; _httpMockRepository = HttpMockRepository.At(hostUrl); _httpMockRepository.Stub(x => x.Get("/endpoint")) .WithHeaders(_firstSetOfHeaders) .Return("I was the first one") .OK(); _httpMockRepository.Stub(x => x.Get("/endpoint")) .WithHeaders(_secondSetOfHeaders) .Return("I was the second one") .OK(); _httpMockRepository.Stub(x => x.Get("/endpoint")) .WithHeaders(_thirdSetOfHeaders) .Return("I was the third one") .OK(); }
public void SetUp() { _hostUrl = HostHelper.GenerateAHostUrlForAStubServer(); }
public void SetUp() { hostUrl = HostHelper.GenerateAHostUrlForAStubServer(); stubHttp = HttpMockRepository.At(hostUrl); }
public void SetUp() { _endpointToHit = HostHelper.GenerateAHostUrlForAStubServerWith("endpoint"); _httpMockRepository = HttpMockRepository.At(_endpointToHit); }
public void SetUp() { _hostUrl = HostHelper.GenerateAHostUrlForAStubServer(); _httpMockRepository = HttpMockRepository.At(_hostUrl); }
public void SetUp() { TestContext.CurrentContext.SetCurrentHostUrl(HostHelper.GenerateAHostUrlForAStubServer()); }
public void SetUp() { _hostUrl = HostHelper.GenerateAHostUrlForAStubServer(); stubHttp = HttpMockRepository.At(_hostUrl); stubHttp.IsAvailable(); }