You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 6
Next »
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 .
- 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 .
- 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
- Finally, the number of codes executed in the Top ribbon.