get_routes (#12)

This commit is contained in:
Stef Heyenrath
2017-01-20 21:25:18 +01:00
parent 6c16d45256
commit f4ce2dbeb3
7 changed files with 61 additions and 103 deletions

View File

@@ -72,6 +72,20 @@ namespace WireMock.Server
}
}
/// <summary>
/// Gets the routes.
/// </summary>
public IEnumerable<Route> Routes
{
get
{
lock (((ICollection)_routes).SyncRoot)
{
return new ReadOnlyCollection<Route>(_routes);
}
}
}
/// <summary>
/// Start this FluentMockServer.
/// </summary>
@@ -95,31 +109,6 @@ namespace WireMock.Server
return new FluentMockServer(port, ssl);
}
/// <summary>
/// Create this FluentMockServer.
/// </summary>
/// <param name="port">
/// The port.
/// </param>
/// <param name="ssl">
/// The SSL support.
/// </param>
/// <returns>
/// The <see cref="FluentMockServer"/>.
/// </returns>
[PublicAPI]
public static FluentMockServer Create(int port = 0, bool ssl = false)
{
Check.Condition(port, p => p > 0, nameof(port));
if (port == 0)
{
port = Ports.FindFreeTcpPort();
}
return new FluentMockServer(port, ssl);
}
/// <summary>
/// Initializes a new instance of the <see cref="FluentMockServer"/> class, and starts the server.
/// </summary>
@@ -195,15 +184,15 @@ namespace WireMock.Server
/// <summary>
/// The given.
/// </summary>
/// <param name="requestSpec">
/// <param name="requestMatcher">
/// The request matcher.
/// </param>
/// <returns>
/// The <see cref="IRespondWithAProvider"/>.
/// </returns>
public IRespondWithAProvider Given(IRequestMatcher requestSpec)
public IRespondWithAProvider Given(IRequestMatcher requestMatcher)
{
return new RespondWithAProvider(RegisterRoute, requestSpec);
return new RespondWithAProvider(RegisterRoute, requestMatcher);
}
/// <summary>