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
Ragula SivakumarRagula Sivakumar 

Regarding Test Class


I have cretaed a batch class based on some condition lead records are deleted and scdule using scheduled method using developer cosole.
Do we need to write test  class for both implement class and schedule class?



 
Snehil_JaiswalSnehil_Jaiswal

Hi Ragula,

You only need to write the test class for schedule class.

For more information please go through this blog: http://amitsalesforce.blogspot.com/2017/07/how-to-write-test-class-for-scheduler.html (http://amitsalesforce.blogspot.com/2017/07/how-to-write-test-class-for-scheduler.html" target="_blank)

Hope this will help you.

Thanks 

Ragula SivakumarRagula Sivakumar
Hi  Jaiswal,

Thansks you for your reply .I have gone through the above blog.

I have written a test class for scheduel class after checking the code coverage for scheduel class is 100% where as  fro implement class it is 19%.

do we need to covergae 75% for implement class?

Regards,
Siva Ragula.




 
Snehil_JaiswalSnehil_Jaiswal

Hi Ragula
Yes, if it is required then you need to write the test class for implement as well.