Updated Scenarios and States (markdown)

Stef Heyenrath
2023-05-12 22:05:13 +02:00
parent f7caa49eec
commit f0abdc348a
+64 -4
@@ -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
[
{ {
"Guid": "60d65393-1556-46ad-9206-8a0ab725b099",
"UpdatedAt": "2023-05-12T20:03:46.693747Z",
"Scenario": "To do list", "Scenario": "To do list",
"SetStateTo": "TodoList State Started", "SetStateTo": "TodoList State Started",
"Request": { "Request": {
"Path": "/todo/items", "Path": {
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "/todo/items",
"IgnoreCase": false
}
]
},
"Methods": [ "Methods": [
"get" "GET"
] ]
}, },
"Response": { "Response": {
"StatusCode": 200, "BodyDestination": "SameAsSource",
"Body": "Buy milk" "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 # Stay in the same State for a number of requests