I'm trying to make a test class for an Apex class that runs a report and add functionality for it (send some emails and stuff). The problem is that I need to add records (contacts) for that report to work with, but I cannot make them fit the conditions required in the report.
The report conditions are:
checkbox = TRUE AND edit date = TODAY
In the testMethod I do:
Contact c = new Contact(checkbox__c = FALSE); insert c; c.checkbox__c = TRUE; update c; System.debug('>>'+c.checkbox__c+', '+c.LastModifiedDate) // run the report...
And this prints in the log:
USER_DEBUG |DEBUG|>>TRUE, null
The checkbox its set to
TRUE correctly but he LastModifiedDate is set to
null when it was updated just now. The report runs correctly but says that it have not records to show and end the execution.
Thanks for the help.