• Harry Austin
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
But, My code is executing well without errors. Please check the below code and let me know your comments,

Class Code------
public class LeadAccContact {
@future
    public static void LeadAcc(set<Id> lIds)
{
    list <lead> l=[select id,FirstName,LastName,phone,email from lead where id in :lIds];
    list<account> a=new list<account>();
    list<contact> c=new list<contact>();
    for(lead tld:l)
    {
       account k=new account(name=tld.Company,phone=tld.phone);
       a.add(k);
       contact j=new contact(Lastname=tld.Lastname+' '+ tld.FirstName);
       c.add(j);
        
    }
    Insert a;
    Insert c;

}
}

----Trigger---

trigger leadACC_CON on Lead(after insert) {
LeadAccContact.LeadAcc(Trigger.newMap.keySet());
}
Hello,

I have created  a class and a trigger seperately for a  custom object. They are working good.  I wrote a TESTCLASS to check wehether my class is working or not. TestClass also successfully executed my method in the testClass with 100% code coverage.

Then, my question is , how my testClass can recognise the "class" particularly to test. I didnt call any class/Method in my TestClass to refer my actual logoc.    
 
Hello,

I have created  a class and a trigger seperately for a  custom object. They are working good.  I wrote a TESTCLASS to check wehether my class is working or not. TestClass also successfully executed my method in the testClass with 100% code coverage.

Then, my question is , how my testClass can recognise the "class" particularly to test. I didnt call any class/Method in my TestClass to refer my actual logoc.