This repository compares different BDD frameworks for .NET.
BDD promotes a behaviour focussed approach to testing, often providing extremely readable output that can often be presented and understood by project stakeholders.
BDD adds additional context when writing tests, something that is often lost when writing tests with traditional unit testing frameworks.
Finding a good balance between a test framework that offers the expressiveness of BDD without bloating tests or requiring a lot of ceremony is a challenge, especially in .NET since most frameworks are really being driven by the underlying test runners (XUnit/NUnit).
The system being tested is a simplified component taken from a payment gateway. AuthorizationProcessor
is responsible for dispatching a payment request to one or more acquirers. The business requires that failures are handled gracefully and in certain circumstances we can cascade from one acquirer to another.
Browse to the NSpec tests directory and run dotnet run
Browse to the XBehave directory and run dotnet test
. This uses the XUnit test runner.
To see more details output run dotnet test --verbosity normal