Create Advanced Parameterized Test
This example shows how to create a test that is parameterized in the TestClassSetup,
TestMethodSetup, and Test methods blocks. The example test class tests the random
number generator.Test OverviewThe TestRand test class is parameterized at three different levels.Parameterization
LevelParameterization Definition Accessible
Parameterization
PropertiesMethod Attribute Property AttributeTest level Test TestParameter TestParameter,
MethodSetupParam
eter, and
ClassSetupParame
ter
Method setup level TestMethodSetup MethodSetupParam
eterMethodSetupParam
eter and
ClassSetupParame
ter
Class setup level TestClassSetup ClassSetupParame
terClassSetupParame
terAt each test level, you can use the ParameterCombination method attribute to specify
the test parameterization.ParameterCombinatio
n AttributeMethod Invocation'exhaustive' (default)Methods are invoked for all combinations of parameters. The
test framework uses this default combination if you do not
specify the ParameterCombination attribute.
'sequential' Methods are invoked with corresponding values from each
parameter. Each parameter must contain the same number of
values.33 Unit Testing