You need to sign in to do that
Don't have an account?
John Manager Training Dep
code coverage for interface?
Hi Team,
I have the interface mentioned below,
public interface MainInterface {
void bInsert();
void bUpdate();
void bDelete();
void aInsert();
void aUpdate();
void aDelete();
void aUndelete();
}
I want to get overall code coverage of 100% for the interface, Any suggestions please?
I have the interface mentioned below,
public interface MainInterface {
void bInsert();
void bUpdate();
void bDelete();
void aInsert();
void aUpdate();
void aDelete();
void aUndelete();
}
I want to get overall code coverage of 100% for the interface, Any suggestions please?
Interfaces cannot have code coverage. Interfaces have in practice 0 lines that could be covered and thus they remain at 0% coverage. That does not have any impact on the 75% rule. Just make sure that you test the implementing classes properly and you should be good to go.
Regards,
MKR
Greetings to you!
The interface doesn't need to be tested but any class that implements the interface will need test coverage.
Above interface does not need to be test covered but the implementations do need coverage.
Please refer to the below link which might help you further.
https://sfdcknowledgebank.wordpress.com/2013/09/30/code-coverage-for-interface/
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
The interface doesn't need to be tested but any class that implements the interface will need test coverage. So,
does not need to be test covered but the implementations of the above interface need coverage.
For detail, please go to the below link:
https://developer.salesforce.com/forums/?id=906F000000092cdIAA
https://salesforce.stackexchange.com/questions/51757/how-to-achieve-test-coverage-for-interface-classes
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
www.ajaydubedi.com
Thanks for the wonderful responses. I created a class that implements the interface.
I created Test Class for above,
Even though the test class covered 100% for MainInterfaceImplements , I still see the code coverage for interface as 0%. If I understand, its correct and would not impact moving the code to next stage. Please correct me.
Please let me know if could find documentation on this.