Main Content

isCompatible

Class: matlab.unittest.fixtures.Fixture
Package: matlab.unittest.fixtures

Determine if two fixtures of the same class are interchangeable

Syntax

TF = isCompatible(f1, f2)

Description

TF = isCompatible(f1, f2) determines if two fixtures of the same class are interchangeable. The isCompatible method returns either logical 1 (true) or logical 0 (false).

A class that derives from Fixture must implement the isCompatible method if its constructor accepts any input arguments or is otherwise configurable. Fixture subclasses use this method to define a notion of interchangeability of fixtures. Two matlab.unittest.fixtures instances of the same class are considered to be interchangeable if the isCompatible method returns true. The test framework uses the result of isCompatible to determine whether two fixture instances of the same class correspond to the same shared test fixture state. The test framework always calls the isCompatible method with two fixture instances of the same class, so the fixture author does not need to implement code to handle the case where the second fixture is a different fixtures class.

Input Arguments

f

matlab.unittest.fixtures.Fixture instance

Attributes

AccessProtected

To learn about attributes of methods, see Method Attributes.