Skip to main content

Testing & Quality

codecov .NET

OpenCaptcha uses two main types of tests to ensure code quality:

  1. Unit Tests
  2. Functional Tests

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:
    1. Open the solution in Visual Studio.
    2. Go to Test > Test Explorer.
    3. 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

  1. Visual Studio:
    1. Open the solution in Visual Studio.
    2. Go to Test > Test Explorer.
    3. Run tests within the Captcha.FunctionalTests project.