Given, When and Then helper classes for testing

Insight — 27th October 2023
Jar filled with pickles
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

CTA 2

Ready to collaborate?

Experience the ClearBank difference and begin your journey today.

Begin

Let’s stay in touch

You're subscribed!

Subscribe for our insights, news and exclusive events – straight to your inbox

Thanks for connecting with us.