EvalCaseActionGen Generator Example

This lesson will provide a simple example for using the EvalCaseActionGen Generator, which can be used to generate complex, conditioned test data.

What is the EvalCaseActionGen Generator?

The EvalCaseActionGen Generator emulates multiple if-then-else cases by returning the first true value.

Syntax:

  • case1 == false
  • case2 == true
  • case3 == true

case2 will be returned because it is the first true case.

Note: For more information about each Parameter, click here.

Step 1: Replace the Assigned Generator with the RandomGen Generator

A RandomGen Generator will be referenced for var1 within the EvalCaseActionGen Generator. This Generator will need to be assigned and configured first.

Within the Quick Generator Replacement Menu, enter RandomGen and select the RandomGen Generator.

Then click the Replace button.

Enter 100 for endRange Parameter and click the Save Generator button.

Step 2: Add an EvalCaseActionGen Generator

Click on the Add Generator button.

Enter EvalCaseActionGen in the filter input field and click on the Plus (+) to select it.

Step 3: Reference gen1 (RandomGen Generator) for var1

Double click on the var1 Parameter.

Select the Attribute Generator Tab and click on the Plus (+) for gen1.

Note: Additional Generators or Values can be used for the var2, var3, var4, and var5 Parameters. Only var1 is being used for this example to keep it simple.

Step 4: Enter a value for the default Parameter

The default Parameter value is what will be used when none of the cases are met. It can be a reference or a constant value. For this example, 0 has been entered.

Step 5: Enter the Cases for the caseList Parameter

A Case can be a constant value or reference another Generator. For this example, each Case will be an Equation that will have a corresponding Action. When the first “True” Case is encountered, the corresponding Action will be used.

Enter each Case value into the caseList Parameter input field and then press the Enter key.

For this example, (var1 == 50) has been entered.

Complete the same steps to enter additional cases for the caseList Parameter.

Step 6: Enter the Action for each Case within the actionList Parameter

An Action can be a constant value or reference another Generator. For this example, each Action will be a constant value.

Enter each value into the actionList Parameter input field and then press the Enter key.

For this example, Red has been entered.

Complete the same steps to enter additional actions for the actionList Parameter. Remember to click the Save Generator button.

Sample Output Data

Related Assets

GenRocket - Test Data Management

Download Literature

View Literature
GenRocket - Test Data Management

View Blog

Read More
GenRocket - Test Data Management

How can we help
you today?

Request a Demo

See how GenRocket can solve your toughest test data challenge with quality synthetic data by-design and on-demand