Package: matlab.unittest.constraints
Superclasses: matlab.unittest.constraints.Constraint
Constraint specifying function handle that throws MException
The Throws
class creates a constraint that is
satisfied only if the actual value is a function handle that throws
a specific exception.
If the function throws an MException
and
the ExpectedException
property of the constraint
is an error identifier, a qualification failure occurs if the actual MException
thrown
has a different identifier. Alternately, if the ExpectedException
property
is a meta.class
, the constraint is not satisfied
if the actual MException
thrown does not derive
from the ExpectedException
.
outConstObj = Throws(
provides
a constraint, excep
)outConstObj
, specifying a function
handle that throws a particular MException
, excep
.
outConstObj = Throws(
provides
a constraint with additional options specified by one or more excep
,Name,Value
)Name,Value
pair
arguments.
|
Error identifier or |
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside single quotes (' '
). You can
specify several name and value pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
|
Expected causes, specified as a cell array of character vectors
or an array of The testing results in a qualification failure if any causes
specified in Default: |
|
Number of outputs the constraint should request when invoking the function handle, specified as a non-negative, real, scalar integer. Default: |
|
Indicator whether to respect the set of expected causes, specified
as Default: |
|
Expected |
|
Number of output arguments the instance uses when executing
functions. Set this property through the constructor via the name-value
pair argument, |
|
Expected causes for the function handle throwing an |
|
Indicator if the constraint respects set elements, specified
through the constructor via the name-value pair argument, |
Handle. To learn how handle classes affect copy operations, see Copying Objects.
MException
| error
| matlab.unittest.constraints
| matlab.unittest.constraints.IssuesWarnings