WithProxy

This commit is contained in:
Stef Heyenrath
2017-05-07 10:01:31 +02:00
parent 7bfd9f3343
commit 2c8142b93d
5 changed files with 6 additions and 6 deletions

View File

@@ -30,11 +30,11 @@ namespace WireMock.Net.Console.NETCoreApp
server
.Given(Request.Create().WithPath("/bbc").UsingGet())
.RespondWith(Response.Create().FromProxyUrl("http://www.bbc.com"));
.RespondWith(Response.Create().WithProxy("http://www.bbc.com"));
server
.Given(Request.Create().WithPath("/google").UsingGet())
.RespondWith(Response.Create().FromProxyUrl("http://www.google.com"));
.RespondWith(Response.Create().WithProxy("http://www.google.com"));
server
.Given(Request.Create().WithPath(p => p.Contains("x")).UsingGet())

View File

@@ -12,6 +12,6 @@ namespace WireMock.ResponseBuilders
/// </summary>
/// <param name="proxyUrl">The proxy url.</param>
/// <returns>A <see cref="IResponseBuilder"/>.</returns>
IResponseBuilder FromProxyUrl([NotNull] string proxyUrl);
IResponseBuilder WithProxy([NotNull] string proxyUrl);
}
}

View File

@@ -244,7 +244,7 @@ namespace WireMock.ResponseBuilders
/// <param name="proxyUrl">The proxy url.</param>
/// <returns>A <see cref="IResponseBuilder"/>.</returns>
[PublicAPI]
public IResponseBuilder FromProxyUrl(string proxyUrl)
public IResponseBuilder WithProxy(string proxyUrl)
{
Check.NotEmpty(proxyUrl, nameof(proxyUrl));

View File

@@ -471,7 +471,7 @@ namespace WireMock.Server
if (!string.IsNullOrEmpty(responseModel.ProxyUrl))
{
return responseBuilder.FromProxyUrl(responseModel.ProxyUrl);
return responseBuilder.WithProxy(responseModel.ProxyUrl);
}
if (responseModel.StatusCode.HasValue)

View File

@@ -360,7 +360,7 @@ namespace WireMock.Net.Tests
_server = FluentMockServer.Start();
_server
.Given(Request.Create().WithPath("/*"))
.RespondWith(Response.Create().FromProxyUrl("http://www.google.com"));
.RespondWith(Response.Create().WithProxy("http://www.google.com"));
// when
var result = await new HttpClient().GetStringAsync("http://localhost:" + _server.Ports[0] + "/foo");