Unit tests can be used to evaluate program functions and / or classes directly. You can either enter the class/function names and/or class/function parameters and the expected values or write your own unit test.
Here is a brief list of some of the unit testing frameworks that are installed on their respective stack environment.
.NET 5.0 and .NET core 3.1
NUnit or xUnit
Adding a Unit Test
To add an unit test, navigate to Checks in the left sidebar and use the New Check + button. Next, select the Unit Test option in the drop-down and see the settings below:
Settings that are used for both basic and advanced unit tests are shown below.
A summary of what this unit test is checking. Shown to users if the task is live and checks are shared (which is the default).
Toggle this to show the advanced unit test form.
Unit Test settings - Advanced enabled
The advanced unit test template allows you to write unit tests using your own code. Each advanced unit test template comes with an example of the testing module for that test framework in that environment.
A list of files to import into the unit test (e.g. header files, source files). Add one per line.
Basic Form Settings
The optional name of the class to instantiate an instance of to test.
The optional parameters to use when initializing the class instance.
The function to call. If a class name is provided, this will be called against the instantiated class instance.
The parameters to pass to the function.
The comparison operator to use.
The value the function should return.
The absolute path to the root directory of the project. This is only necessary if the unit test must run in the project folder (e.g. for .NET unit tests).
Advanced Form Settings
The full test contents (excluding imports) to run.
Optionally specify a command to run the unit test.