matlab.unittest.Test class

Package: matlab.unittest
Superclasses: matlab.unittest.TestSuite

Specification of a single test method


The matlab.unittest.Test class holds the information needed for the TestRunner object to be able to run a single Test method of a TestCase class. A scalar Test instance is the fundamental element contained in TestSuite arrays. A simple array of Test instances is a commonly used form of a TestSuite array.



Name of the Test element.


Row vector of parameters required for the Test. The Parameterization property contains all the parameterized data needed by the TestRunner.


Row vector of fixtures required for the Test. The SharedTestFixtures property contains all the fixtures specified by the SharedTestFixtures class-level attribute of the TestCase class.


expand all

Show Class of a TestSuite Array

Create a suite of Test objects of all test methods in the BankAccountTest class.

import matlab.unittest.TestSuite;
suite = TestSuite.fromClass(?BankAccountTest); 

whos suite
  Name       Size            Bytes  Class                   Attributes

  suite      1x5              1636  matlab.unittest.Test 

Each test is a matlab.unittest.Test object.

Display test method names.

ans = 

Was this topic helpful?