Support int values for states and scenario naming (#376)

* Support int values for states and scenario naming
* fix remove added dependency
This commit is contained in:
Noah Lerner
2019-11-21 13:01:20 +02:00
committed by Stef Heyenrath
parent 9b323ab388
commit 0ff23a3d15
3 changed files with 125 additions and 2 deletions

View File

@@ -93,7 +93,13 @@ namespace WireMock.Server
return this;
}
/// <see cref="IRespondWithAProvider.WhenStateIs"/>
/// <see cref="IRespondWithAProvider.InScenario(int)"/>
public IRespondWithAProvider InScenario(int scenario)
{
return InScenario(scenario.ToString());
}
/// <see cref="IRespondWithAProvider.WhenStateIs(string)"/>
public IRespondWithAProvider WhenStateIs(string state)
{
if (string.IsNullOrEmpty(_scenario))
@@ -106,7 +112,13 @@ namespace WireMock.Server
return this;
}
/// <see cref="IRespondWithAProvider.WillSetStateTo"/>
/// <see cref="IRespondWithAProvider.WhenStateIs(int)"/>
public IRespondWithAProvider WhenStateIs(int state)
{
return WhenStateIs(state.ToString());
}
/// <see cref="IRespondWithAProvider.WillSetStateTo(string)"/>
public IRespondWithAProvider WillSetStateTo(string state)
{
if (string.IsNullOrEmpty(_scenario))
@@ -118,5 +130,11 @@ namespace WireMock.Server
return this;
}
/// <see cref="IRespondWithAProvider.WillSetStateTo(int)"/>
public IRespondWithAProvider WillSetStateTo(int state)
{
return WillSetStateTo(state.ToString());
}
}
}