Sign Up

Testing

To ensure the proper functioning of your functions, it is essential to create tests that validate their output and ensure the reliability of your classes.

To create tests, switch your class to test mode by clicking the "Tests" button in the bottom toolbar. This will display an alternate workspace dedicated to test functions and tests. You can return to your normal class workspace by clicking the same button.

Tests are created similarly to functions, but they do not have parameters. Instead, they include an additional statement type called "Add Assertion", which allows you to verify variable values and function return objects.

There are several types of assertions available for testing:

  • Is Equal To: Verifies whether the object is equal to another object.
  • Is Not Equal To: Verifies whether the object is not equal to another object.
  • Is Null: Confirms whether the object is null.
  • Is Not Null: Confirms whether the object is not null.
  • Text Contains: Ensures that the text contains the specified characters.
  • Text Does Not Contain: Ensures that the text does not contain the specified characters.
  • Text Size: Confirms the expected character length of the text.

You can execute individual tests by clicking the "Run Test" button located above a test, or you can run all tests simultaneously by clicking "Run Tests" at the top of the class.

After running the tests, you will receive a result indicating whether your tests have passed or failed. It is crucial for all tests to pass successfully to build a reliable and error-free API. Properly written tests provide confidence in the correctness of your functions and contribute to the overall stability of your workspace.

Related Topics

Statements

In a function, various types of statements can be created to perform specific actions and control the flow of execution: Create Variable: Generates a new variable, which can be initialized from scratch, reference an existing variable or parameter, the result of a function, retrieve data from the dat...

Global Variables

To access the view of global variables, simply click on the globe icon located in the workspace toolbar within a class. Additionally, you can press CTRL + G to initiate the opening of the global variables view. Global variables are variables declared at the global scope, providing accessibility from...

Variables

A variable encompasses various data types, including: Text: A string of characters Number: Ranging between -2147483648 and 2147483647 Boolean: Representing true or false Currency: Similar to Number but specific to prices Email: Similar to Text but designed for email addresses Date: A representation ...

Import Classes

In the current class, you have the option to import your own classes and utilize functions that were created earlier. This helps minimize the requirement for duplicate classes. Once a class is imported, you can access all of its functions by using the "Run function" statement.

What is a Class?

A class in the API serves as a structured entity that holds both variables and functions. These functions are used in both endpoints and events to define specific functionalities. Variable A variable within the API is represented by a symbolic name or identifier, acting as a storage location in the ...