I am learning to Unit Test and struggling with some probably pretty basic concepts. Let's say I have two methods.
Method A takes a file as input and returns a complex object hierarchy.
Method B takes the object hierarchy and does something with it.
I understand how to test Method A (and the various other methods that it calls in turn). I am confused with how to best test Method B.
I can build up a fake object heirarchy in my unit test to be the input to Method B but when I do this it feels like my unit test has become less of a test on Method B and more of a test of whether I manually created a valid object heirarchy correctly.
It would seem more logical to me to test Method A, keep the output and then use that to test Method B but I understand that each unit test is only meant to test one thing.
I (think) I understand the concept of mocking and faking, but I'm not sure that is the answer here as Method B is going to use the whole object heirarchy not just look at a small part of it.