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
pujapuja 

Test class Coverage

Cod ecoverage for this class

 

public class MDFException extends Exception{

}

 

 

 

It's urgent ...please help

Best Answer chosen by Admin (Salesforce Developers) 
ngabraningabrani

Just create a simple method in the class, and put a debug statement in the method. In the test case after the class has been created, invoke this simple method.

All Answers

ngabraningabrani

Looks like you have an empty class. In your test case, just declare a variable of type of this class and then allocate memory to this variable.

pujapuja

I have wrote This

 

 

public class MDFException extends Exception{

     static testMethod void TestUnit() {
            MDFException  obj;
            obj = new  MDFException  ();
     }
}

 

But it is not give coverage .

 

ngabraningabrani

Just create a simple method in the class, and put a debug statement in the method. In the test case after the class has been created, invoke this simple method.

This was selected as the best answer
pujapuja

Thanks