From f0abdc348a943318d6f636722134d2e21167f37b Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Fri, 12 May 2023 22:05:13 +0200 Subject: [PATCH] Updated Scenarios and States (markdown) --- Scenarios-and-States.md | 86 ++++++++++++++++++++++++++++++++++------- 1 file changed, 73 insertions(+), 13 deletions(-) diff --git a/Scenarios-and-States.md b/Scenarios-and-States.md index 6ec16b9..37cf8a4 100644 --- a/Scenarios-and-States.md +++ b/Scenarios-and-States.md @@ -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