2022

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
Testing Your Function

For Testing a user defined function , the function To test a User Defined Function, it has to be accompanied by a method Generally generally started with header "//@Test". The user has to must save the created function before proceeding with Testing the FunctionFunction before testing it.

The following code snippet shows the Test method required to test the previously created Append Function.

Code Block
  //@Test
function testFirstAndLastName(){//@Test
function testFirstAndLastName(){
  var firstname = "Xxxxxx";
  var lastname = "Yyyyy";
  addFirstAndLastNames(firstname, lastname);
}  var firstname = "Xxxxxx"; var lastname = "Yyyyy";  addFirstAndLastNames(firstname, lastname);
}

The following screen shot depicts shows the user User Defined function Function along with Test method required to execute it.

  1. After writing the Test method, immediately after the UDF, which it is a good practice, user can save by hitting save button best practice to Save. The Save button is located at the top right corner of the page .
  2. Now Here, a user is prompted to select the available Test Methods in a pop-up, so that he/she . As a result, s/he can select the appropriate name and hit click on "Run Tests" button.
  3. Finally, the number of codes executed in code lines executed is shown on the Top ribbon.