Refactor TestDetermineTargetLinearChainDependencies