Supported and Unsupported Object Test Bench Scenarios

Although Object Test Bench (OTB) can be used to test simple classes and their methods and to discover quickly the behavior of an API library, there are several unsupported scenarios that are described in the following sections. When OTB encounters an unsupported scenario, testing halts and an error message is displayed. In this case, you may need to write a separate test harness for that particular application feature. For more information, see Object Test Bench and How to: Create and Display an Instance of an Object.

Restrictions on Class Declarations

OTB will show all functions, methods, constructors, or subroutines of a class, regardless of the access modifier used, such as public, private, protected and so forth. Notice, however, that OTB is subject to the following restrictions:

  • The function, method, constructor, or subroutine cannot be an operator.

  • The function, method, constructor, or subroutine cannot be a destructor.

  • The function, method, constructor, or subroutine cannot be a Generic "Generic" implies a common language runtime (CLR) Generics in CLR version 2.0.

Restrictions on Parameters and Return Types

OTB exercises a variety of method parameters and return types. When testing your applications, please note that the return types and all parameters of functions, methods, constructors, or subroutines must satisfy the following conditions:

  • Return types and parameters cannot be a Generic. "Generic" implies a CLR Generics in CLR version 2.0.

  • Return types and parameters can be any type of array: any dimensions, jagged or rectangular.

  • Return types and parameters can be any class, struct, interface, or enum.

  • Return types and parameters cannot be a mathematical expression. For example, the following would not work: return myInt + 3/AnotherInt;

  • Variable parameters are not supported.

  • Return types can be void.

  • Parameters can have in, out, or ref modifiers.

Note

Value types that correspond to primitive types are not usable through OTB.

See Also

Other Resources

Object Test Bench