• Arpit Goyal
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I have written a try catch block but dont know how to unit test it .Below is the code .

try{
        Schema.SObjectField extField = Order.Fields.id__c;
        List<Database.upsertResult> listOfResults = Database.upsert(listOfOrder,extField,false);

    }
    catch(Exception e)
    {
        for(Order listOrder: listOfOrder)
        {
         Error_Log__c error = new  Error_Log__c();
         System.debug('Error'+e);
         }
    }

Please help me to see if my upsert works fine or not in this logic.