mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-20 07:21:21 +02:00
Expose scenario states (#168)
* Scenarios (WIP) * Update ToJson and StatefulBehaviorTests * fix tests * Update comment
This commit is contained in:
@@ -12,8 +12,8 @@ namespace WireMock.Server
|
||||
private int _priority;
|
||||
private string _title;
|
||||
private string _path;
|
||||
private object _executionConditionState;
|
||||
private object _nextState;
|
||||
private string _executionConditionState;
|
||||
private string _nextState;
|
||||
private string _scenario;
|
||||
private readonly RegistrationCallback _registrationCallback;
|
||||
private readonly IRequestMatcher _requestMatcher;
|
||||
@@ -87,25 +87,20 @@ namespace WireMock.Server
|
||||
}
|
||||
|
||||
/// <see cref="IRespondWithAProvider.WhenStateIs"/>
|
||||
public IRespondWithAProvider WhenStateIs(object state)
|
||||
public IRespondWithAProvider WhenStateIs(string state)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_scenario))
|
||||
{
|
||||
throw new NotSupportedException("Unable to set state condition when no scenario is defined.");
|
||||
}
|
||||
|
||||
//if (_nextState != null)
|
||||
//{
|
||||
// throw new NotSupportedException("Unable to set state condition when next state is defined.");
|
||||
//}
|
||||
|
||||
_executionConditionState = state;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <see cref="IRespondWithAProvider.WillSetStateTo"/>
|
||||
public IRespondWithAProvider WillSetStateTo(object state)
|
||||
public IRespondWithAProvider WillSetStateTo(string state)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_scenario))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user