• GM_91
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies

hiii this is my test class....i just want to write a test coverage for this code.....but i got only 50% of code coverage...can anyone plsss...help me out....

 

public class MultipleStdntView1_AC
{
   public pagereference save()
   {
       return null;
    }
   String recordId;
   public MultipleStdntView1_AC()
   {
      recordId = system.currentpagereference().getparameters().get('id');
      c = [select Name,dept_email__c,dept_ID__c from department__c where id =: recordId];
      stdntlist = [Select Name,Email__c,phone__c,percentage__c from Student__c where department__c =: c.id];
    }
  
   Department__c c = new Department__c();
   public department__c getdepartmentDetails()
   {
     return c;
   }
   List<Student__c> stdntlist = new List<Student__c>();
   public List<Student__c> getstudentDetails()
   {
     return stdntlist;
   }
   public PageReference edit() 
    {
        return null;
    }

    public PageReference deleteRecords() 
    {
        return null;
    }
   
}

 

 

the red colored lines are the uncovered....

and also can you pls..tel me about "how to call a list & a loop?

  • August 09, 2013
  • Like
  • 0

hiii this is my test class....i just want to write a test coverage for this code.....but i got only 50% of code coverage...can anyone plsss...help me out....

 

public class MultipleStdntView1_AC
{
   public pagereference save()
   {
       return null;
    }
   String recordId;
   public MultipleStdntView1_AC()
   {
      recordId = system.currentpagereference().getparameters().get('id');
      c = [select Name,dept_email__c,dept_ID__c from department__c where id =: recordId];
      stdntlist = [Select Name,Email__c,phone__c,percentage__c from Student__c where department__c =: c.id];
    }
  
   Department__c c = new Department__c();
   public department__c getdepartmentDetails()
   {
     return c;
   }
   List<Student__c> stdntlist = new List<Student__c>();
   public List<Student__c> getstudentDetails()
   {
     return stdntlist;
   }
   public PageReference edit() 
    {
        return null;
    }

    public PageReference deleteRecords() 
    {
        return null;
    }
   
}

 

 

the red colored lines are the uncovered....

and also can you pls..tel me about "how to call a list & a loop?

  • August 09, 2013
  • Like
  • 0