function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
miku1051miku1051 

help with test class.???urgent.

public with sharing class createmassleadcntr {
public Lead ld{get;set;}
public Lead ld1{get;set;}
public list<Lead> listld=new list<lead> ();
public boolean perinfo{get;set;}
public boolean sav{get;set;}
    public createmassleadcntr(ApexPages.StandardController controller)
    {
        perinfo=false;
        ld=new Lead();
        ld1=new Lead();
        sav=false;
    }

public void add()
{
        sav=true;
        system.debug('------'+ld);
        if(ld.lastname==null)
        {
            perinfo=true;
        }
 
        else
        {
          
            ld.Company=ld1.Company;
            ld.Phone=ld1.Phone;
            ld.street=ld1.street;
            ld.LeadSource=ld1.LeadSource;
            listld.add(ld);
            ld=new Lead();
            
        }
       
}
public void save()
{
    sav=false;
    if(ld.lastname!=null && ld.Company!=null)
    {
        ld.Company=ld1.Company;
        ld.Phone=ld1.Phone;
        ld.street=ld1.street;
        ld.LeadSource=ld1.LeadSource;
        listld.add(ld);
    }
        upsert listld;
        ld=new Lead();
        ld1=new Lead();
        perinfo=false;
}

 can some pl help me with test class...i am not able to cover ...pl help///

RadnipRadnip
What tests have you created so far? What are the positive and negative tests that you want to do on your code?