FCF 2.0 development in progress...
> > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

fcf.NUnitest.Unitest class

Package: fcf-framework-unitest

File: fcf-framework-unitest:unitest.js

Available from version: 1.0.1

A class that implements the full functionality of the unit testing framework

Detailed description

The framework's unit testing functionality does not use direct class instantiation. The fcf-framework-unitest:unitest.js module returns the main instance of the fcf.NUnitest.Unitest class that is used to run the test.

Methods
add(string a_part, string a_group, string a_name, function a_cbtest)
add(string a_group, string a_name, function a_cbtest)
add(string a_name, function a_cbtest)
- Registers a test
fcf.Actions->object run()
fcf.Actions->object run(object a_options)
- Runs tests, both on the server side and on the browser side
compare(string a_operation, mixed a_left, mixed a_right, boolean a_strict = false)
- Compares two values using the given comparison operation a_operation, and if the comparison returns false, then raises a test error.
error(Error|string a_error)
- Causes an error in the executable test.
equal(mixed a_left, mixed a_right, boolean a_strict = false)
- Compares two values and if they are not equal raises a test error
notEqual(mixed a_left, mixed a_right, boolean a_strict = false)
- Compares two values and if they are equal raises a test error
less(mixed a_left, mixed a_right)
- Compares two values and if the first value is greater or equal to the second than, throws a test error.
lessEqual(mixed a_left, mixed a_right)
- Compares two values, and if the first value is not less or equal to the second than, throws a test error.
greater(mixed a_left, mixed a_right)
- Compares two values and if the first value is not greater than throws a test error.
greaterEqual(mixed a_left, mixed a_right)
- Compares two values and if the first value is not greater or not equal to the second then, throws a test error.