2022

Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Current »

Testing Your Function
For Testing a user defined function , the function has to be accompanied by a method Generally started with header "//@Test". The user has to save the created function before proceeding with Testing the Function.

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

 //@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 the user User Defined function along with Test method required to execute it .

  1. After writing the Test method immediately after the UDF ,which is a good practice, user can save by hitting save button located at the top right corner of the page .
  2. Now user is prompted to select the available Test Methods in a pop-up, so that he/she can select the appropriate name and hit "Run Tests" button
  3. Finally, the number of codes executed in the Top ribbon.  
  • No labels