Technology27th October 2023

Given, When and Then helper classes for testing

Microsoft Teams image 68
Share article

Our recent Medium post introduces a method of organising test code into shared, reusable chunks, enabling complex tests to be expressed in a terse English-like fashion. It demonstrates creating a class for each of the 'Given, When and Then' from the popular Gherkin Syntax. These classes provide a fluent interface to chain test steps together without bringing in additional dependencies and remaining unopinionated about test or assertion frameworks.

Andrew Poole, L5 Senior Software Engineer at ClearBank

Further reading

We use cookies to make your experience on our website better. By clicking on “Accept Cookies”, you are agreeing for cookies to be used. More information.