UnitTest
Class defining a unit test.
Back to Simple Unit Testing Toolbox Documentation.
Contents
Properties
Variable | Description | Format |
UNIT_TEST | function handle assigned to unit test function | 1×1 function_handle |
test_args | input arguments to unit test function | cell array |
name | test name | char array |
passed | true if test passed, false otherwise | 1×1 logical |
Constructor
unit_test = UnitTest(UNIT_TEST,test_args,name)
Variable | Description | Format |
UNIT_TEST | function handle assigned to unit test function | 1×1 function_handle |
test_args | input arguments to unit test function | cell array |
name | test name | char array |
run
n_passed = UnitTest.run(n_passed,n_run,color)
Description: Runs the unit test and prints the results to the Command Window.
Inputs:
Variable | Description | Format |
n_passed | number of tests that have passed so far | 1×1 double |
n_run | number of tests that have been run so far | 1×1 double |
color | true if test result should be printed in color, false otherwise | 1×1 logical |
Outputs:
Variable | Description | Format |
n_passed | updated number of tests that have passed so far | 1×1 double |
See also
TestEqual | TestNotEqual | TestNotEqual | TestNoError | TestSpeed