matlab.unittest.fixtures.Fixture Class
Namespace: matlab.unittest.fixtures
Fundamental interface for test fixtures
Description
The matlab.unittest.fixtures.Fixture
class provides an interface for test
fixtures. Fixtures specify setup and teardown code that sets up the test environment and
restores it to its original state after running the test.
A Fixture
subclass must implement the setup
method, which makes changes to the environment when the testing framework
sets up the fixture. To restore the environment when the framework tears down the fixture,
call the addTeardown
method within the
setup
method, or implement the teardown
method.
In addition to specifying setup and teardown actions in your Fixture
subclass, you must implement the isCompatible
method if the fixture is
configurable (for example, if its class constructor accepts input arguments). The testing
framework calls isCompatible
to determine whether instances of the same
Fixture
subclass correspond to the same shared test fixture state.
The matlab.unittest.fixtures.Fixture
class is a handle
class.
Properties
Methods
Events
Event Name | Trigger | Event Data | Event Attributes |
---|---|---|---|
AssumptionFailed | Triggered upon failing assumption. A QualificationEventData
object is passed to listener callback functions. | matlab.unittest.qualifications.QualificationEventData |
|
AssumptionPassed | Triggered upon passing assumption. A QualificationEventData
object is passed to listener callback functions. | matlab.unittest.qualifications.QualificationEventData |
|
AssertionFailed | Triggered upon failing assertion. A QualificationEventData
object is passed to listener callback functions. | matlab.unittest.qualifications.QualificationEventData |
|
AssertionPassed | Triggered upon passing assertion. A QualificationEventData
object is passed to listener callback functions. | matlab.unittest.qualifications.QualificationEventData |
|
FatalAssertionFailed | Triggered upon failing fatal assertion. A QualificationEventData
object is passed to listener callback functions. | matlab.unittest.qualifications.QualificationEventData |
|
FatalAssertionPassed | Triggered upon passing fatal assertion. A QualificationEventData
object is passed to listener callback functions. | matlab.unittest.qualifications.QualificationEventData |
|
ExceptionThrown | Triggered by the test runner when it catches an exception in the test content. An
ExceptionEventData object is passed to listener callback
functions. | matlab.unittest.qualifications.ExceptionEventData |
|
DiagnosticLogged | Triggered upon a call to the log method. A
LoggedDiagnosticEventData object is passed to listener callback
functions. | matlab.unittest.diagnostics.LoggedDiagnosticEventData |
|