You need to sign in to do that
Don't have an account?
Krystal D. Carter
Test Class Error: Argument must be an object that implements Database.Batchable
Hi I'm getting the same the following error on my test class: "Argument must be an object that implements Database.Batchable"
I've used this code multiple times before in regards to an Apex Sharing Rule. But in this org it's throwing an error. I've bolded the line that's throwing the error. Any help would be appreciated.
@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();
}
}
I've used this code multiple times before in regards to an Apex Sharing Rule. But in this org it's throwing an error. I've bolded the line that's throwing the error. Any help would be appreciated.
@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();
}
}
public static testmethod void testoppertunity() {
List<Account> listacc = new List<Account>();
Account acc1 = new Account(Name = 'TestAccountName');
Insert acc1;
List<Opportunity> listOpportunity = new list<Opportunity >();
for(Integer i = 0 ; i<=100 ;i++) { Opportunity opp1 = new Opportunity() ;
opp1.Name ='Test'+i;
opp1.accountid = acc1.id;
opp1.StageName = 'Closed Won';
opp1.CloseDate=Date.Today();
listOpportunity.add(opp1);
}
Test.startTest();
insert listOpportunity;
Test.stopTest();
}
}
i thaught you want do bulkfy operations on test class
i hope its is use full or not
Thanks
Amit Chaudhary