+ Start a Discussion
sh-at-youseesh-at-yousee 

How to modify LastModifiedDate in test method?

Hi,

 

I have a class that search for cases where LastModifiedDate is 3 business days in the past. All cases found are modified and then updated accordingly.

 

My question is this: How do I create a test case in my test method where LastModifiedDate is e.g. 5 business days ago to ensure proper code coverage (nd verify the outcome?

 

Cheers.

 

Søren Nødskov Hansen

gotherthanthougotherthanthou

I don't know whether this will be of help in your case or not.  They seem to only let you have it active for limted periods of time.

 

http://2020james.wordpress.com/2010/07/06/modifiable-system-fields/