+ 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