applyFixture
Class: matlab.unittest.TestCase
Namespace: matlab.unittest
Use fixture with test case
Description
applyFixture(
sets up the specified fixture for use with the test case and then tears it down after
testing.testCase
,fixture
)
Use applyFixture
within a Test
method,
TestMethodSetup
method, or TestClassSetup
method.
The timing and frequency of the setup and teardown actions depend on the scope in which you
call the method:
Test
method — TheapplyFixture
method sets up the fixture for the current test and tears it down after the test runs.TestMethodSetup
method — TheapplyFixture
method sets up the fixture before and tears it down after each test in the test class.TestClassSetup
method — TheapplyFixture
method sets up the fixture a single time for the entire test class and tears it down after all the tests in the class run.
f = applyFixture(
provides access to the fixture after setup by returning it as a testCase
,fixture
)matlab.unittest.fixtures.Fixture
object.
Input Arguments
Examples
Version History
Introduced in R2013b