You need to sign in to do that
Don't have an account?
sridhar sridhar
Code Coverage not success
//These two sections are not covering in code coverage plz provide a solution
section1
for(Case selectedCase : selectedCases)
{
caselist.add(selectedCase);
section 2
catch (DMLException e){
for(case c :caselist){
c.adderror('xxxxxx.');
section1
for(Case selectedCase : selectedCases)
{
caselist.add(selectedCase);
section 2
catch (DMLException e){
for(case c :caselist){
c.adderror('xxxxxx.');
Section 1,
Try to insert some cases before you are trying to call the particular method from your test method.
Section 2,
Intetionally insert some data which can cause an exception in your code when you are executing. I'd recommend that you do that in a seperate test method.
Test Class :
See, I didnt insert a case in the second method and when the code is getting executed it will throw an exception.
Hope this helps.