Introduction
The Given-When-Then pattern helps us write clear and simple tests by breaking them into three easy steps: setup, action, and check.
When you want to test a feature step-by-step like a story.
When you want your tests to be easy to read and understand by anyone.
When you want to organize your test code clearly into preparation, action, and verification.
When you want to explain what your test does in simple language.
When you want to follow a common style used in behavior-driven testing.