+ Start a Discussion
sudhakar reddy 13sudhakar reddy 13 

Test Class for Static Method in Apex in Salesforce – with example

Vinoth Vijaya BaskerVinoth Vijaya Basker
public class Demo{
    public static integer i =0;
    public static void demoMethod(){
        i = 15;    
    }
}

Test Class for above class
@isTest(seeAllData = False)
    private class TestDemo{
        static testMethod void validatedemoMethod() {
            Demo.demoMethod();
            System.assert(Demo.i == 15);
        }
}