function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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);
        }
}