You need to sign in to do that
Don't have an account?
Ritik 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;
}
}
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;
}
}
You can call the method from a test class, similar to how you call method from other classes.
Non-Static method to be called with instance of the class as-
ClassName classInstanceObj = new ClassName();
classInstanceObj.MethodName();