You need to sign in to do that
Don't have an account?

please execute this test class code coverage......
global class BatchClass2 implements Database.Batchable<sObject>{
global final String Query;
global final String Entity;
global final String Field;
global final String Value;
global BatchClass2(String q, String e, String f, String v){
Query=q; Entity=e; Field=f;Value=v;
}
global Database.QueryLocator start(Database.BatchableContext BC){
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC,
List<sObject> scope){
for(Sobject s : scope){s.put(Field,Value);
} update scope;
}
global void finish(Database.BatchableContext BC){
}
}
test class
@isTest
public class BatchClass_Test2
{
static testMethod void test() {
Database.QueryLocator QL;
Database.BatchableContext BC;
List<Account> AcctList = new List<Account>();
BatchClass2 AU = new BatchClass2('Name', 'Test');
QL = AU.start(bc);
Database.QueryLocatorIterator QIT = QL.iterator();
while (QIT.hasNext())
{
Account Acc = (Account)QIT.next();
System.debug(Acc);
AcctList.add(Acc);
}
AU.execute(BC, AcctList);
AU.finish(BC);
}
}
global final String Query;
global final String Entity;
global final String Field;
global final String Value;
global BatchClass2(String q, String e, String f, String v){
Query=q; Entity=e; Field=f;Value=v;
}
global Database.QueryLocator start(Database.BatchableContext BC){
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC,
List<sObject> scope){
for(Sobject s : scope){s.put(Field,Value);
} update scope;
}
global void finish(Database.BatchableContext BC){
}
}
test class
@isTest
public class BatchClass_Test2
{
static testMethod void test() {
Database.QueryLocator QL;
Database.BatchableContext BC;
List<Account> AcctList = new List<Account>();
BatchClass2 AU = new BatchClass2('Name', 'Test');
QL = AU.start(bc);
Database.QueryLocatorIterator QIT = QL.iterator();
while (QIT.hasNext())
{
Account Acc = (Account)QIT.next();
System.debug(Acc);
AcctList.add(Acc);
}
AU.execute(BC, AcctList);
AU.finish(BC);
}
}

can you please share your emailid any doubts is there i will message you