matlab.mock.TestCase class
Package: matlab.mock
Superclasses: matlab.unittest.TestCase
TestCase
to write tests with mocking
framework
Description
Use the matlab.mock.TestCase
class
to write tests that use the mocking framework. The matlab.mock.TestCase
derives
from the matlab.unittest.TestCase
class.
Construction
The testing framework constructs the matlab.mock.TestCase
instances.
Methods
assertAccessed | Assert that a property was accessed |
assertCalled | Assert that a method was called with certain input values |
assertNotAccessed | Assert that a property was not accessed |
assertNotCalled | Assert that a method was not called with certain input values |
assertNotSet | Assert that a property was not set |
assertSet | Assert that a property was set |
assignOutputsWhen | Define return values for method call or property access |
assumeAccessed | Assume that a property was accessed |
assumeCalled | Assume that a method was called with certain input values |
assumeNotAccessed | Assume that a property was not accessed |
assumeNotCalled | Assume that a method was not called with certain input values |
assumeNotSet | Assume that a property was not set |
assumeSet | Assume that a property was set |
clearMockHistory | Clear history of mock object interactions |
createMock | Create mock object |
fatalAssertAccessed | Fatally assert that a property was accessed |
fatalAssertCalled | Fatally assert that a method was called with certain input values |
fatalAssertNotAccessed | Fatally assert that a property was not accessed |
fatalAssertNotCalled | Fatally assert that a method was not called with certain input values |
fatalAssertNotSet | Fatally assert that a property was not set |
fatalAssertSet | Fatally assert that a property was set |
forInteractiveUse | Create TestCase for interactive use of mock objects |
getMockHistory | Return history of mock interactions from TestCase
instance |
returnStoredValueWhen | Return stored value when property is accessed |
storeValueWhen | Store value when property is set |
throwExceptionWhen | Throw exception for method call or property interaction |
verifyAccessed | Verify that a property was accessed |
verifyCalled | Verify that a method was called with certain input values |
verifyNotAccessed | Verify that a property was not accessed |
verifyNotCalled | Verify that a method was not called with certain input values |
verifyNotSet | Verify that a property was not set |
verifySet | Verify that a property was set |
Inherited Methods
addTeardown | Dynamically add teardown code to test case |
applyFixture | Use fixture with test case |
createTemporaryFolder | Create temporary folder |
forInteractiveUse | Create test case for interactive use |
getSharedTestFixtures | Provide access to shared test fixtures |
log | Record diagnostic information during test execution |
onFailure | Dynamically add diagnostics for test failures |
run | Run tests corresponding to test case |
Also, the TestCase
class inherits methods from these
classes:
matlab.unittest.qualifications.Assertable | Qualification to validate preconditions of a test |
matlab.unittest.qualifications.Assumable | Qualification to filter test content |
matlab.unittest.qualifications.FatalAssertable | Qualification to abort test execution |
matlab.unittest.qualifications.Verifiable | Qualification to produce soft-failure conditions |
Copy Semantics
Handle. To learn how handle classes affect copy operations, see Copying Objects.
Examples
Version History
Introduced in R2017a