Task 1: Selecting a constructor
You select the constructor that you want to use for the tests.
About this task
The Scenarios sheet of the Excel scenario file template contains both required and optional columns, which are defined by the ruleset input parameters. The BOM classes that make up the input parameters have constructors whose arguments correspond to the required columns in the Scenarios sheet. When there are several constructors for the same class, you must select the constructor that generates the correct columns.
In this task, you select a new constructor for the Borrower class that includes the same arguments as the original constructor, but with an
additional creditScore argument.
If you have already imported the loanvalidation-xom and loanvalidation-rules project into your workspace, delete them or use a new workspace.
Step 1: Importing the start project
You import the start project.
Procedure
Step 2: Checking the project
You check the project.
Procedure
Step 3: Selecting a constructor
You look at the constructors of the Borrower class in the BOM editor. You select the one for tests.
Procedure
- In the BOM editor, browse the list of members. You see two constructors.
- Double-click the constructor that has five arguments: Borrower(String,String,Date,String,int) constructor. You define it to use it for tests.
- In the General Information area, select the Testing and simulation constructor check box.
- Save your changes.
- Check the project as you did in Step 2. The dialog now reports five errors.
- Select the errors in the Testing and Simulation BOM view. They correspond to the arguments in the selected constructor, but they should correspond to an attribute in the BOM.
What to do next
In the next task, you give meaningful names to the arguments of the constructor.