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
MOHAMMEDISHAQUESHAIKHMOHAMMEDISHAQUESHAIKH 

is it necessary to write test class for custom Exception ?

Custom Exception Class
public MyException extends Exception{
}
  • Do we need to Write the test class for deployment ?
  • Code coverage is 0% will it be able to move to prod environment?
I have written the test class but it is not covering the above class.
@isTest
public class MyTest{
    static testmethod void testMethod(){
          try{
                 throw new MyException();
          }catch(Exception ex){}
    }

}

 
Ivory TollersIvory Tollers
I think yes