Package: matlab.unittest.qualifications
Qualification to produce soft failure conditions
The Verifiable
class provides a qualification
to produce soft-failure conditions. Apart from actions performed for
failures, the Verifiable
class works the same as
other matlab.unittest
qualifications.
Upon a verification failure, the Verifiable
class
informs the testing framework of the failure, including all diagnostic
information associated with the failure, but continues to execute
the currently running test without throwing an MException
.
This is most useful when a failure at the verification point is not
fatal to the remaining test content. Often, you use verifications
as the primary verification of a Four-Phase Test. Use other qualification
types, such as assertions, fatal assertions, and assumptions, to test
for violation of preconditions or incorrect test setup.
Since verifications do not throw MException
s, all test content runs to completion even when verification failures occur. This helps you understand how close a piece of software is to meeting the test suite requirements. Qualification types that throw exceptions do not provide this insight, since once an exception is thrown an arbitrary amount of code remains that is not reached or exercised. Verifications also provide more testing coverage in failure conditions. However, when you overuse verifications, they can produce excess noise for a single failure condition. If a failure condition will cause later qualification points to also fail, use assertions or fatal assertions instead.
verifyClass | Verify exact class of specified value |
verifyEmpty | Verify value is empty |
verifyEqual | Verify value is equal to specified value |
verifyError | Verify function throws specified exception |
verifyFail | Produce unconditional verification failure |
verifyFalse | Verify value is false |
verifyGreaterThan | Verify value is greater than specified value |
verifyGreaterThanOrEqual | Verify value is greater than or equal to specified value |
verifyInstanceOf | Verify value is object of specified type |
verifyLength | Verify value has specified length |
verifyLessThan | Verify value is less than specified value |
verifyLessThanOrEqual | Verify value is less than or equal to specified value |
verifyMatches | Verify string matches specified regular expression |
verifyNotEmpty | Verify value is not empty |
verifyNotEqual | Verify value is not equal to specified value |
verifyNotSameHandle | Verify value is not handle to specified instance |
verifyNumElements | Verify value has specified element count |
verifyReturnsTrue | Verify function returns true when evaluated |
verifySameHandle | Verify two values are handles to same instance |
verifySize | Verify value has specified size |
verifySubstring | Verify string contains specified string |
verifyThat | Verify value meets given constraint |
verifyTrue | Verify value is true |
verifyWarning | Verify function issues specified warnings |
verifyWarningFree | Verify function issues no warnings |
VerificationFailed | Triggered upon failing verification. A |
VerificationPassed | Triggered upon passing verification. A |
Handle. To learn how handle classes affect copy operations, see Copying Objects.
Assertable
| Assumable
| FatalAssertable
| matlab.unittest.qualifications
| QualificationEventData
| TestCase