You need to sign in to do that
Don't have an account?
R@v!
how to write test class for batch class.
global class UserLogJob implements Schedulable {
global void execute(SchedulableContext SC) {
EmailUserLogController M = new EmailUserLogController();
m.UserLog();
}
}
global void execute(SchedulableContext SC) {
EmailUserLogController M = new EmailUserLogController();
m.UserLog();
}
}
Please try below Test class i hope that will help you Let us know if this will help you
All Answers
private class UserLogJobTest {
static testMethod void userTest() {
UserLogJob M = new UserLogJob();
Test.startTest();
Database.executeBatch(M,1);
Test.stopTest();
}
}
Thanks
Sandeep Singhal
Error: Argument must be an object that implements Database.Batchable
Please try below Test class i hope that will help you Let us know if this will help you
@istest
public class testAgreementsharecalc
{
Public static testMethod void testingagreementsharecalc()
{
Test.startTest();
agreementsharecalc sb = new agreementsharecalc();
Apttus__APTS_Agreement__c objAgreement = new Apttus__APTS_Agreement__c();
objAgreement.Apttus__Requestor__c = UserInfo.getUserId();
insert objAgreement;
ID batchprocessid = Database.executeBatch(sb);
Test.stopTest();
}
}