I've Class A
that has an instance of another Class B
. I've completed unit testing of independent code in Class B
. For other operations, Class A
invokes methods of Class B
, does some processing using other classes and then invokes methods of Class B
.
My question is how do I mock the dependency of Class A
and complete unit testing of Class B
? If Class B
uses instance of Class A
, I can mock Class A
and complete the task. However, in my case Class A
uses instance of Class B
.
How do I mock in this scenario for unit testing?