mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-23 00:38:28 +02:00
Updated Scenarios and States (markdown)
@@ -50,21 +50,81 @@ Check.That(getResponse2).Equals("Buy milk;Cancel newspaper subscription");
|
|||||||
```
|
```
|
||||||
|
|
||||||
The first Scenario and State definition can also be used in the JSON Admin interface like:
|
The first Scenario and State definition can also be used in the JSON Admin interface like:
|
||||||
```js
|
``` json
|
||||||
{
|
[
|
||||||
"Scenario": "To do list",
|
{
|
||||||
"SetStateTo": "TodoList State Started",
|
"Guid": "60d65393-1556-46ad-9206-8a0ab725b099",
|
||||||
"Request": {
|
"UpdatedAt": "2023-05-12T20:03:46.693747Z",
|
||||||
"Path": "/todo/items",
|
"Scenario": "To do list",
|
||||||
"Methods": [
|
"SetStateTo": "TodoList State Started",
|
||||||
"get"
|
"Request": {
|
||||||
]
|
"Path": {
|
||||||
|
"Matchers": [
|
||||||
|
{
|
||||||
|
"Name": "WildcardMatcher",
|
||||||
|
"Pattern": "/todo/items",
|
||||||
|
"IgnoreCase": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Methods": [
|
||||||
|
"GET"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Response": {
|
||||||
|
"BodyDestination": "SameAsSource",
|
||||||
|
"Body": "Buy milk"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"Response": {
|
{
|
||||||
"StatusCode": 200,
|
"Guid": "8bd98789-4b55-4084-bb5b-fba85176f3a6",
|
||||||
"Body": "Buy milk"
|
"UpdatedAt": "2023-05-12T20:03:46.6937938Z",
|
||||||
|
"Scenario": "To do list",
|
||||||
|
"WhenStateIs": "TodoList State Started",
|
||||||
|
"SetStateTo": "Cancel newspaper item added",
|
||||||
|
"Request": {
|
||||||
|
"Path": {
|
||||||
|
"Matchers": [
|
||||||
|
{
|
||||||
|
"Name": "WildcardMatcher",
|
||||||
|
"Pattern": "/todo/items",
|
||||||
|
"IgnoreCase": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Methods": [
|
||||||
|
"POST"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Response": {
|
||||||
|
"StatusCode": 201
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Guid": "0b818c7c-3778-4504-9baf-229aa57bf1e1",
|
||||||
|
"UpdatedAt": "2023-05-12T20:03:46.6938425Z",
|
||||||
|
"Scenario": "To do list",
|
||||||
|
"WhenStateIs": "Cancel newspaper item added",
|
||||||
|
"Request": {
|
||||||
|
"Path": {
|
||||||
|
"Matchers": [
|
||||||
|
{
|
||||||
|
"Name": "WildcardMatcher",
|
||||||
|
"Pattern": "/todo/items",
|
||||||
|
"IgnoreCase": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Methods": [
|
||||||
|
"GET"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Response": {
|
||||||
|
"BodyDestination": "SameAsSource",
|
||||||
|
"Body": "Buy milk;Cancel newspaper subscription"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
# Stay in the same State for a number of requests
|
# Stay in the same State for a number of requests
|
||||||
|
|||||||
Reference in New Issue
Block a user