Skip to content

3. Testing and developing tools

Alexander Hansson edited this page Apr 9, 2023 · 1 revision

Setup Test Environment

No matter the chosen setup method, it´s required to start an external database server before running the tests for them to pass. This is due to some tests utilizing black-box testing through testing against the controllers. It may take a while for the container to populate the tables with the example data, so if most controller-tests fail during the first run try to run them again.

NOTE: Running docker-compose in Visual Studio and then the tests do for some reason not work. To run the tests:

sudo docker run -d --name nexpo_database -p 5432:5432 -e POSTGRES_USER=nexpo -e POSTGRES_PASSWORD=nexpo postgres:14
sudo dotnet test Nexpo.Tests/

View endpoints in swagger

Swagger allows you to see the specifications of an API, including the endpoints, request parameters, response formats, and authentication methods. It provides an user interface for interacting with the API and testing its functionality. With Swagger, you can visualize and document your API in a standardized way, making it easier for developers to understand and use your API.

To open the application in swagger:

  1. Start the backend
  2. Go to http://localhost:5000/swagger/index.html

Clone this wiki locally