stateful behavior + tests

This commit is contained in:
deeptowncitizen
2017-10-04 15:57:49 -04:00
parent 8827531391
commit ab017beaa6
8 changed files with 193 additions and 3 deletions

View File

@@ -34,6 +34,17 @@ namespace WireMock
/// </value>
public int Priority { get; }
/// <summary>
/// Execution state condition for the current mapping.
/// </summary>
public object ExecutionConditionState { get; }
/// <summary>
/// The next state which will be signaled after the current mapping execution.
/// In case the value is null state will not be changed.
/// </summary>
public object NextState { get; }
/// <summary>
/// The Request matcher.
/// </summary>
@@ -53,8 +64,25 @@ namespace WireMock
/// <param name="provider">The provider.</param>
/// <param name="priority">The priority for this mapping.</param>
public Mapping(Guid guid, [CanBeNull] string title, IRequestMatcher requestMatcher, IResponseProvider provider, int priority)
: this(guid, title, requestMatcher, provider, priority, null, null)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Mapping"/> class.
/// </summary>
/// <param name="guid">The unique identifier.</param>
/// <param name="title">The unique title (can be null_.</param>
/// <param name="requestMatcher">The request matcher.</param>
/// <param name="provider">The provider.</param>
/// <param name="priority">The priority for this mapping.</param>
/// <param name="executionConditionState">State in which the current mapping can occur. Happens if not null</param>
/// <param name="nextState">The next state which will occur after the current mapping execution. Happens if not null</param>
public Mapping(Guid guid, [CanBeNull] string title, IRequestMatcher requestMatcher, IResponseProvider provider, int priority, object executionConditionState, object nextState)
{
Priority = priority;
ExecutionConditionState = executionConditionState;
NextState = nextState;
Guid = guid;
Title = title;
RequestMatcher = requestMatcher;