• Mikasa Ackerman
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
How write test class for the following code it:-
    
        public static void script(){
            List<OpportunityLineItem> oppLine= new List<OpportunityLineItem>();
    oppLine=[Select TotalPrice from OpportunityLineItem where Name like '%abc%' AND OpportunityId IN (Select id from Opportunity Where StageName='Closed Won')];
     System.debug(oppLine);

     Decimal tp=0;

    for(OpportunityLineItem op1:oppLine){
        tp=tp+op1.TotalPrice;
    }
    System.debug(tp);
        }
    
    I could not reach the 75% for above code.
    Thanks