mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-29 13:21:50 +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:
|
||||
```js
|
||||
{
|
||||
"Scenario": "To do list",
|
||||
"SetStateTo": "TodoList State Started",
|
||||
"Request": {
|
||||
"Path": "/todo/items",
|
||||
"Methods": [
|
||||
"get"
|
||||
]
|
||||
``` json
|
||||
[
|
||||
{
|
||||
"Guid": "60d65393-1556-46ad-9206-8a0ab725b099",
|
||||
"UpdatedAt": "2023-05-12T20:03:46.693747Z",
|
||||
"Scenario": "To do list",
|
||||
"SetStateTo": "TodoList State Started",
|
||||
"Request": {
|
||||
"Path": {
|
||||
"Matchers": [
|
||||
{
|
||||
"Name": "WildcardMatcher",
|
||||
"Pattern": "/todo/items",
|
||||
"IgnoreCase": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"Methods": [
|
||||
"GET"
|
||||
]
|
||||
},
|
||||
"Response": {
|
||||
"BodyDestination": "SameAsSource",
|
||||
"Body": "Buy milk"
|
||||
}
|
||||
},
|
||||
"Response": {
|
||||
"StatusCode": 200,
|
||||
"Body": "Buy milk"
|
||||
{
|
||||
"Guid": "8bd98789-4b55-4084-bb5b-fba85176f3a6",
|
||||
"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
|
||||
|
||||
Reference in New Issue
Block a user