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
Ritik DwivediRitik Dwivedi 

how to call method from test class

@isTest
private class WarrantySummaryTest {
    @isTest static void createCase(){
        Case myCase = new Case();
        myCase.Product_Purchase_Date__c   = Date.today();
        myCase.Product_Total_Warranty_Days__c = 10;
        myCase.Product_Has_Extended_Warranty__c = true;
        insert myCase;
            
    }

}
Danish HodaDanish Hoda
Hi Ritik,
You can call the method from a test class, similar to how you call method from other classes.
Ritik DwivediRitik Dwivedi
please write the code 
Danish HodaDanish Hoda
For ex: Static method can be called as - ClassName.MethodName(),
Non-Static
method to be called with instance of the class as-
ClassName classInstanceObj = new ClassName();
classInstanceObj.MethodName();