You need to sign in to do that
Don't have an account?
Kishan Kumar 77
i have a custom label that contains a query which is using a past date as criteria for 'systemmodstamp' field.
How do I write a test class for a class that uses a query from custom label using a past date. I am running a query that fetches records of a custom object with a where clause as
Select Id, Name, etc from custom_object__c where systemmodstamp >= 2014-11-15T13:00:00.000Z and systemmodstamp <= 2014-11-15T22:00:00.000Z.
Please help me to write a test class so that it satisfies the code coverage requirement.
Select Id, Name, etc from custom_object__c where systemmodstamp >= 2014-11-15T13:00:00.000Z and systemmodstamp <= 2014-11-15T22:00:00.000Z.
Please help me to write a test class so that it satisfies the code coverage requirement.
You don't need to use custom label in testy class , just insert new record of custom_object__c, and after that fetch by select Query
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
My class is basically a batch class and in my start method I am quering data which has to be passed in the execute method. So when I am calling my batch class in my test class it is not satisfying the code coverage as when my class is called in the start method I am using a condition which fetches data based on systemmodstamp field.
Is there a way I can create records which have systemmodstamp field value as my requirement?