You need to sign in to do that
Don't have an account?
hramani
Extended Classes' Test Class
If a class extends to another class, should we separate test class for both or one test class is good enough to cover both the classes?
e.g.
public class ApplicationFormParseJSON extends ApplicationForm
{
// operation happens
}
Another Class :
public virtual class ApplicationForm
{
// operation happens
}
Do I need to write separate Test for the virtual class ApplicationForm ? or ApplicationFormParseJSONTest will be good enough?
e.g.
public class ApplicationFormParseJSON extends ApplicationForm
{
// operation happens
}
Another Class :
public virtual class ApplicationForm
{
// operation happens
}
Do I need to write separate Test for the virtual class ApplicationForm ? or ApplicationFormParseJSONTest will be good enough?
You should create separate test class for both the class because class which you extend on the another class, It will not override all your method by default.so that you should use separate test class for both.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
Thanks for the reply Ajay,
If I get the code coverage for both the classes in one test class itself, do I need to write a separate one?
If it works then no need to create separate test class for both.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi