0

I have following line of code:

return (teacher = "Y" || (student = "Y" && TeacherStudent(enty)));

private bool TeacherStudent(ICmpEntity enty)
{
   return (abc.Field("id").Value() != "N");
}

Test like: teacher = Y, student = Y and id = N.

But problem is this line of code is only partially getting covered? Even though TeacherStudent method is covered 100%

return (teacher = "Y" || (student = "Y" && TeacherStudent(enty)));

Is there a way to tell what part of condition is not covered in MS Test? Or any idea why this condition is partially covered?

1 Answer 1

0

You need to create 2 tests, for both parts of your condition clause. If teacher = "Y" , this would prevent to evaluate the second part of the clause.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.