Assert
Last updated
Last updated
The Assert function allows adding run-time checks to assert the validity of predicates that should hold true in a function's processing.
Whenever the condition specified in an Assert fails, an error will occur to indicate the fact and the function's processing will halt.
The type of assertion to evaluate.
See the list of below describing specific additional properties relevant to each type of assertion.
The message to include in the error when the assertion fails.
Verifies that the two values specified are equal.
Expected: The expected value.
Actual: The actual value.
Tolerance: Optional. In case the values are numeric, this specifies the maximum acceptable difference between the expected and actual values.
Verifies that the two items specified hold different values.
Expected: The expected value.
Actual: The actual value.
Asserts that the specified item is contained in the given list.
Item: The item to look for in the list.
List: The list to search in for the specified item.
Verifies that the first value is greater than the second value.
X: The first value, expected to be greater.
Y: The second value, expected to be less than the first.
Verifies that the first value is greater than or equal to the second value.
X: The first value, expected to be greater or equal.
Y: The second value, expected to be less than or equal to the first.
Verifies that the first value is less than the second value.
X: The first value, expected to be less.
Y: The second value, expected to be greater than the first.
Verifies that the first value is less than or equal to the second value.
X: The first value, expected to be less than or equal.
Y: The second value, expected to be greater than or equal to the first.
Asserts that a condition is true.
Condition: The condition to evaluate.
Asserts that a condition is false.
Condition: The condition to evaluate.
Verifies that the item provided holds a null value.
Item: The item to test for null.
Verifies that the item provided does hold a value and is not null.
Item: The item to test for null.
Asserts that a list or string is empty.
Item: The list or string to test for.
Asserts that a list or string is not empty.
Item: The list or string to test for.
Fails unconditionally.
Use to verify that a specific part of a function's processing never executes.