Developer Docs

API tests with C#Bot

The API tests in a C#Bot application are a type of integration test which ensure the APIs that are available through the server of the application are working as expected. This involves building requests which are similar to the requests sent by the application’s client-side, sending those requests to the application’s server-side, interpreting the response from the server, and making assertions based on the response that is received. The assertions are primarily checking that the status code returned is equal to the expected response.

As the API tests require sending a request to the application’s server and interpreting the response, you need to have the server running in order to run the API tests.

The requests created during the API tests are created using RestSharp, a C# Library which allows for building and sending API requests, and interpreting the responses.

On this page