3. Component methods - AJARProject/AJ_Tools_UnitTest GitHub Wiki
New AJ_Tools_UT_describe
Parameters
- describe : (text) description of the test.
- method : (text) method that execute the test (must be "Current method name").
- category : (text) (optional) category of the test. This is used to separate multiple tests in different categories.
Return value
return a unit test object with the assert member function. This object will need 4 parameters (given, should, expected, actual) before to call the assert method.
Description
Create a new test. A test can then do multiple assert. Only one test must be created by method.
AJ_Tools_UT_runAll
Parameters
- methods (collection) (optional) : collections of method to tests.
Return value
(object) parsed results.
Description
This method will run all the tests (or only the given methods) and return the results in an object. It will also log the results in a file located at : "<database_path>/Logs/UnitTestsResults.json".
AJ_Tools_UT_LaunchMainWindow
Parameters
- none
Return value
none.
Description
This method will launch a window that will list all the categories and descriptions (based on the existing log file). You will be able launch all the tests or only for a selected category/description.
AJ_Tools_UT_getInfo
Parameters
- none
Return value
(text) Version number.
Description
This method returns the version number of the component when it has been compiled.
AJ_Tools_UT_OnErrCall
This method is not made to be used, it gives you some code in the comment section of the method. The code shows you how an error handler should be written to be able to fully test the error handling of your unit tests.