// CHANGE switchValue String below to be the test that you are running ASSIGN switchValue = "Phone Creation" ASSIGN typeValidater = "IntToDecimal" DYNAMIC associationValues SWITCH switchValue { // BRANCH TESTS CASE "DefaultValueDeosntMatchDataType" { ASSIGN userFieldName="Default Type Validation XS" // SET datatype to the type you are testing ASSIGN dataType="Integer" SWITCH typeValidater { // BOOLEAN CASE "BooleanToInt" { ASSIGN defaultValue="45" } CASE "BooleanToString" { ASSIGN defaultValue="Default" } CASE "BooleanToDecimal" { ASSIGN defaultValue="45.56" } CASE "BooleanToDate" { ASSIGN defaultValue="12/23/2014" } // DECIMAL CASE "DeciamlToString" { ASSIGN defaultValue="Default" } CASE "DecimalToBoolean" { ASSIGN defaultValue="TRUE" } CASE "DecimalToDate" { ASSIGN defaultValue="12/23/2014" } // DATE CASE "DateToInt" { ASSIGN defaultValue="45" } CASE "DateToString" { ASSIGN defaultValue="Default" } CASE "DateToBoolean" { ASSIGN defaultValue="TRUE" } CASE "DateToDecimal" { ASSIGN defaultValue="45.56" } // INTEGER CASE "IntToString" { ASSIGN defaultValue="Default" } CASE "IntToBoolean" { ASSIGN defaultValue="TRUE" } CASE "IntToDate" { ASSIGN defaultValue="12/23/2014" } CASE "IntToDecimal" { ASSIGN defaultValue = "45.56" } } } CASE "FieldInUseByProcessingFilter" { ASSIGN userFieldName="ValueString" //NAME OF UDF CURRENTLY BEING USED TO FILTER ASSIGN dataType="Boolean" // CHANGE TO DIFFERENT DATATYPE THAN YOUR FIELD ABOVE ASSIGN defaultValue="TRUE" // PUT IN CORRESPONDING DEFAULT } CASE "DataTypeMismatch" { ASSIGN userFieldName="DataTypeMismatch" ASSIGN dataType="Phone" ASSIGN defaultValue="" associationValues.CallerId = "Decimal" associationValues.Description = "Decimal" associationValues.Compliance = "Integer" associationValues.Attempts = "ValueString" } CASE "InvalidDataType" { ASSIGN userFieldName="InvalidDataType" ASSIGN dataType="MyAwesomeDataType!" } CASE "NoNameProvided" { ASSIGN userFieldName="" ASSIGN dataType="Boolean" ASSIGN defaultValue="TRUE" } CASE "UDFNotFound" { ASSIGN userFieldName="UDFNotFound" ASSIGN dataType="Phone" ASSIGN defaultValue="" associationValues.CallerId = "No Exist" associationValues.Description = "No Workie" associationValues.Compliance = "No Exist" } CASE "InvalidSubField" { ASSIGN userFieldName="InvalidSubField" ASSIGN dataType="Phone" ASSIGN defaultValue="" associationValues.CallerId = "ValueString" associationValues.Description = "ValueString" associationValues.Compliance = "Boolean" associationValues.Attempts = "Integer" associationValues.MyCustomField = "Custom" } CASE "DataTypeDoesntSupportDefaultValue" { ASSIGN userFieldName="DataTypeDoesntSupportDefaultValue" ASSIGN dataType="Phone" ASSIGN defaultValue="8675309" associationValues.CallerId = "ValueString" associationValues.Description = "ValueString" associationValues.Compliance = "Boolean" associationValues.Attempts = "Integer" } CASE "InvalidSubTypeDataType" { ASSIGN userFieldName="ValueString" //NAME OF UDF CURRENTLY BEING USED AS CALLERID SUBTYPE ASSIGN dataType="String" ASSIGN defaultValue="" } // CHARACTER TESTS CASE "200 Character Test" { ASSIGN userFieldName="ThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200Character" ASSIGN dataType="Boolean" ASSIGN defaultValue="TRUE" } CASE "200 Character Default Test" { ASSIGN userFieldName="200 Char Default Test" ASSIGN dataType="String" ASSIGN defaultValue="ThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200CharacterTestThisIsA200Character" } CASE "Special Character Test" { ASSIGN userFieldName="SC <> ,./?\| ~`!@#$%^&*()_+=-" ASSIGN dataType="String" ASSIGN defaultValue="" } // CREATION TESTS CASE "Boolean Creation" { ASSIGN userFieldName="Boolean XS" ASSIGN dataType="Boolean" ASSIGN defaultValue="TRUE" } CASE "String Creation" { ASSIGN userFieldName="String XS" ASSIGN dataType="String" ASSIGN defaultValue="" } CASE "Date Creation" { ASSIGN userFieldName="Date XS" ASSIGN dataType="Date" ASSIGN defaultValue="12/23/2014" } CASE "Decimal Creation" { ASSIGN userFieldName="Decimal XS" ASSIGN dataType="Decimal" ASSIGN defaultValue="0.00" } CASE "Integer Creation" { ASSIGN userFieldName="Integer XS" ASSIGN dataType="Integer" ASSIGN defaultValue="35" } CASE "Phone Creation" { ASSIGN userFieldName="Phone XS" ASSIGN dataType="Phone" ASSIGN defaultValue="" associationValues.CallerId = "ValueString" // VALID STRING TYPE CDD ON YOUR BU associationValues.Description = "ValueString" // VALID STRING TYPE CDD ON YOUR BU associationValues.Compliance = "Boolean" // VALID BOOLEAN TYPE CDD ON YOUR BU associationValues.Attempts = "Integer" // VALID INTEGER TYPE CDD ON YOUR BU } // UPDATE TESTS CASE "Update" { // Set userfieldName to a CDD that already exists on your BU ASSIGN userFieldName="Decimal" // Set the datatype to a type that it currently isn't (e.g. currently your cdd is a boolean set it to integer etc) ASSIGN dataType="Integer" } }