Main Content

La traducción de esta página aún no se ha actualizado a la versión más reciente. Haga clic aquí para ver la última versión en inglés.

Pruebas unitarias basadas en clases

Escriba pruebas basadas en clases; parametrice pruebas; aplique accesorios; seleccione y ejecute pruebas

Escriba pruebas de estilo xUnit para comprobar que la salida del código de MATLAB® responde a sus expectativas. Las pruebas unitarias basadas en clases le brindan acceso a todas las funciones del marco de pruebas unitarias. Por ejemplo, puede escribir pruebas parametrizadas, etiquetar las pruebas o usar accesorios de prueba compartidos.

Para comenzar, consulte Author Class-Based Unit Tests in MATLAB y Write Simple Test Case Using Classes.

Funciones

runtestsRun set of tests
testsuiteCreate suite of tests
testrunnerCreate test runner
run (TestSuite)Run TestSuite array using TestRunner object configured for text output
run (TestRunner)Run test suite
run (TestCase)Run tests corresponding to test case
runInParallelRun all tests in TestSuite array in parallel

Clases

matlab.unittest.TestCaseSuperclass of all test classes
matlab.unittest.TestSuiteFundamental interface for grouping tests to run
matlab.unittest.TestSpecification of a single test
matlab.unittest.TestRunnerClass for running tests in matlab.unittest framework
matlab.unittest.TestResultResult of running test suite

Paquetes

matlab.unittestSummary of packages and classes in MATLAB Unit Test Framework
matlab.unittest.qualificationsSummary of classes in MATLAB Qualifications Interface
matlab.unittest.constraintsSummary of classes in MATLAB Constraints Interface
matlab.unittest.diagnostics
matlab.unittest.fixturesSummary of classes in MATLAB Fixtures Interface
matlab.unittest.parametersSummary of classes associated with MATLAB Unit Test parameters
matlab.unittest.pluginsSummary of classes in MATLAB Plugins Interface
matlab.unittest.selectorsSummary of classes in MATLAB Selectors Interface
Simulink.sdi.constraints.MatchesSignalConstraint that compares time series data with tolerances using the Simulation Data Inspector

Temas

Escribir pruebas

Escribir prueba parametrizada

Ejecutar pruebas y analizar resultados