import { getFilledDataDefinition } from "../../../../CommonUI/DataDesigner/Testing/DataTestData";
import { RuleTableDefinition } from "../Structure/RuleTableDefinition";
import * as LogicExpressions from "../../../../Expressions/Test/LogicData";
import { BooleanDataDefinition } from "../../../../Common/Data/Definitions/BooleanDataDefinition";
export const getEmptyRuleTable = () => {
    return new RuleTableDefinition();
};
export const getRuleTableWithMultipleEmptyRows = () => {
    const ruleDefinition = new RuleTableDefinition();
    ruleDefinition.addRuleColumn();
    ruleDefinition.addRuleColumn();
    ruleDefinition.addRuleColumn();
    ruleDefinition.addRow();
    ruleDefinition.addRow();
    ruleDefinition.addRow();
    ruleDefinition.addRow();
    return ruleDefinition;
};
export const getRuleTableWithData = () => {
    const ruleDefinition = new RuleTableDefinition();
    const dataDefinition = getFilledDataDefinition();
    ruleDefinition.inputData = dataDefinition;
    for (let f of dataDefinition.fields) {
        const ruleColumn = ruleDefinition.addRuleColumn(f.name);
        ruleColumn.path = f.name;
    }
    dataDefinition.fields.push(new BooleanDataDefinition("result"));
    ruleDefinition.resultColumns[0].name = "boolean";
    let row = ruleDefinition.addRow();
    row.cells[0].expression = LogicExpressions.getLogicExpressionElseIf();
    ruleDefinition.rows[0].cells[0].expression = LogicExpressions.getLogicExpressionElseIf();
    ruleDefinition.rows[0].cells[1].expression = LogicExpressions.getLogicExpression();
    ruleDefinition.rows[0].cells[2].expression = LogicExpressions.getIfSimpleRule();
    ruleDefinition.rows[0].cells[3].expression = LogicExpressions.getIfElseSimpleRule();
    row = ruleDefinition.addRow();
    row.cells[0].expression = LogicExpressions.getLogicExpressionElseIf();
    ruleDefinition.rows[1].cells[0].expression = LogicExpressions.getLogicExpressionResultElseIfAtEnd();
    ruleDefinition.rows[1].cells[1].expression = LogicExpressions.getLogicExpressionElseIfElseWithSubWithBlanks();
    return ruleDefinition;
};
//# sourceMappingURL=TestDataSetup.js.map