You need to sign in to do that
Don't have an account?

Could any body help me in learning how to writw test classes
So how to write test class for conditional statement & Exceptions in order to achieve test coverage
You need to sign in to do that
Don't have an account?
I am not able the read this image. tell me what problem you are facing
In your case you have give if(PackinAnswer.contains(newPack)), so give an input with value which contains newPack and another for not containing the Newpack. Both positive flow and negative flow,
Sameway for try catch statement also give a scenario where the delete statement in try fails and it passes through catch statements for negative flow.
This approach should give you maximum coverage.
All the best.
Please select this as best answer, if this helped you.