Skip to content

Commit 8dd9680

Browse files
authored
DSL or not? (#7)
* DSL or not? * Update learn/basics/start-with-acceptance.md Co-Authored-By: craigjbass <craig@madetech.com>
1 parent b681a38 commit 8dd9680

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

learn/basics/start-with-acceptance.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,26 @@ In the simplest case, your "Arrange" step is merely a case of calling one or mor
138138
That said, while this is the ideal it may not be practical or possible.
139139

140140
Aim to have your test setup code mimic how you'd expect your application to be used by it's delivery mechanism.
141+
142+
## Should we use Code or a Domain Specific Language?
143+
144+
Gherkin (Cucumber/SpecFlow) and Fitnesse are common DSL choices for writing executable acceptance tests.
145+
146+
If you are involving your (non-programmer) stakeholders in creation and verification of acceptance tests, you should probably use a DSL. If you are not doing this, use code, but try to still use human-readable language.
147+
148+
```Gherkin
149+
Feature: An customer places an order
150+
151+
Scenario: An existing customer places an order
152+
Given an existing customer
153+
And a valid UK billing address
154+
And a valid UK shipping address
155+
And wants to buy 1x sku 19283
156+
When the order is placed
157+
Then the order is viewable
158+
And there is one line item
159+
And there is valid UK shipping address
160+
And there is a valid UK billing address
161+
And there is a line item for 1x sku 19283 for 10.00 GBP
162+
And the order total is 10.00 GBP
163+
```

0 commit comments

Comments
 (0)