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
Miranda L 2Miranda L 2 

How to cover these code in my test class

HI,
I need help to cover following code into my test class
User-added imageUser-added imageUser-added image
pconpcon
You need to craft a test case that meets the criteria.  So you need to have a test method that returns the data that the SOQL query returns, data that fails your try statement, data that causes invoicesToUpdate to not be empty and oldInvoicesToUpdate to not be empty.  Looking at the failed lines here (with the exception of the catch block) it appears that you're not testing your code in a meaningful way.