Factory Design patterns and tests