Added title (linked to #21)

This commit is contained in:
Stef Heyenrath
2017-03-15 12:36:08 +01:00
parent b09b882ad1
commit 37de97ed5d
8 changed files with 92 additions and 18 deletions

View File

@@ -10,6 +10,7 @@ namespace WireMock.Server
{
private int _priority;
private Guid? _guid;
private string _title;
/// <summary>
/// The _registration callback.
@@ -41,7 +42,7 @@ namespace WireMock.Server
public void RespondWith(IResponseProvider provider)
{
var mappingGuid = _guid ?? Guid.NewGuid();
_registrationCallback(new Mapping(mappingGuid, _requestMatcher, provider, _priority));
_registrationCallback(new Mapping(mappingGuid, _title, _requestMatcher, provider, _priority));
}
/// <summary>
@@ -66,6 +67,18 @@ namespace WireMock.Server
return this;
}
/// <summary>
/// Define a unique identifier for this mapping.
/// </summary>
/// <param name="title">The unique identifier.</param>
/// <returns>The <see cref="IRespondWithAProvider"/>.</returns>
public IRespondWithAProvider WithTitle(string title)
{
_title = title;
return this;
}
/// <summary>
/// Define the priority for this mapping.
/// </summary>