This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

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.


Name of the folder that contains the file defining the test content. For tests defined in packages, the base folder is the parent of the top-level package folder.


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.


Cell array of tags applied to the test element.


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?