Testing & Quality
OpenCaptcha uses two main types of tests to ensure code quality:
1. Unit Tests
- Framework: NUnit
- Location: Housed in a project named
Captcha.UnitTests
. - Purpose:
- Verify the logic of individual methods or classes in isolation.
- Ensure that changes in the code do not break existing functionality.
How to Run Unit Tests
You can run the unit tests in one of the following ways:
- Visual Studio:
- Open the solution in Visual Studio.
- Go to Test > Test Explorer.
- Run tests within the Captcha.UnitTests project.
2. Functional Tests
- Framework: Reqnroll using Gherkin syntax.
- Location: Housed in a project named
Captcha.FunctionalTests
. - Purpose:
- Validate the end-to-end behavior of the API by simulating real usage scenarios.
- Ensure that the API meets expected outcomes when various inputs are given.
How to Run Functional Tests
- Visual Studio:
- Open the solution in Visual Studio.
- Go to Test > Test Explorer.
- Run tests within the Captcha.FunctionalTests project.