mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-17 22:19:39 +02:00
Rename to WireMock.Net
This commit is contained in:
42
src/WireMock.Net/Server/RespondWithAProvider.cs
Normal file
42
src/WireMock.Net/Server/RespondWithAProvider.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using WireMock.Matchers.Request;
|
||||
|
||||
namespace WireMock.Server
|
||||
{
|
||||
/// <summary>
|
||||
/// The respond with a provider.
|
||||
/// </summary>
|
||||
internal class RespondWithAProvider : IRespondWithAProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// The _registration callback.
|
||||
/// </summary>
|
||||
private readonly RegistrationCallback _registrationCallback;
|
||||
|
||||
/// <summary>
|
||||
/// The _request matcher.
|
||||
/// </summary>
|
||||
private readonly IRequestMatcher _requestMatcher;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RespondWithAProvider"/> class.
|
||||
/// </summary>
|
||||
/// <param name="registrationCallback">The registration callback.</param>
|
||||
/// <param name="requestMatcher">The request matcher.</param>
|
||||
public RespondWithAProvider(RegistrationCallback registrationCallback, IRequestMatcher requestMatcher)
|
||||
{
|
||||
_registrationCallback = registrationCallback;
|
||||
_requestMatcher = requestMatcher;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The respond with.
|
||||
/// </summary>
|
||||
/// <param name="provider">
|
||||
/// The provider.
|
||||
/// </param>
|
||||
public void RespondWith(IResponseProvider provider)
|
||||
{
|
||||
_registrationCallback(new Mapping(_requestMatcher, provider));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user