You need to sign in to do that
Don't have an account?
ayvak
please help me increasing in Testclass code coverage!!!
Test.startTest();
Contract contractObj2 = new Contract(StartDate=System.today(),ContractTerm=5,Status='Draft',RetentionOpportunityCreateFlag__c = false,AccountId = accountObj1.Id);
insert contractObj2;
ApexPages.currentPage().getParameters().put('id',accountObj1.id);
ApexPages.StandardController sc2 = new ApexPages.StandardController(accountObj1);
Retention_Opportunity_Extension_Acc oppered2 = new Retention_Opportunity_Extension_Acc (sc2);
// oppered2.recTypesForOpp1 = RecordTypeId;
oppered2.testFlag = false;
oppered2.installedService();
oppered2.lstLineItems = lstLineItems;
oppered2.lstNonRecurringLineItems = lstNonRecurringLineItems;
oppered2.lstProd = lstProd;
oppered2.getFees('Collections', 'Commercial', oMAT.Id, null);
oppered2.refOppty = contractObj1 ;
oppered2.createopportunity(accountObj1.Id);
oppered2.CreateExistingOpportunityService(accountObj1.Id);
oppered2.createservicelist(con.Id,accountObj1.Id);
oppered2.CreateSnapshotOpportunity();
for (GetInstalledServiceWebService.InstalledServiceRecord ir : lstLineItems)
oppered2.getSuggestedServiceDay(ir);
Test.stopTest();
}
}
Contract contractObj2 = new Contract(StartDate=System.today(),ContractTerm=5,Status='Draft',RetentionOpportunityCreateFlag__c = false,AccountId = accountObj1.Id);
insert contractObj2;
ApexPages.currentPage().getParameters().put('id',accountObj1.id);
ApexPages.StandardController sc2 = new ApexPages.StandardController(accountObj1);
Retention_Opportunity_Extension_Acc oppered2 = new Retention_Opportunity_Extension_Acc (sc2);
// oppered2.recTypesForOpp1 = RecordTypeId;
oppered2.testFlag = false;
oppered2.installedService();
oppered2.lstLineItems = lstLineItems;
oppered2.lstNonRecurringLineItems = lstNonRecurringLineItems;
oppered2.lstProd = lstProd;
oppered2.getFees('Collections', 'Commercial', oMAT.Id, null);
oppered2.refOppty = contractObj1 ;
oppered2.createopportunity(accountObj1.Id);
oppered2.CreateExistingOpportunityService(accountObj1.Id);
oppered2.createservicelist(con.Id,accountObj1.Id);
oppered2.CreateSnapshotOpportunity();
for (GetInstalledServiceWebService.InstalledServiceRecord ir : lstLineItems)
oppered2.getSuggestedServiceDay(ir);
Test.stopTest();
}
}
Amit Chaudhary 8
Please share your apex class for which you are creating Test class