Function get PortfolioManagerWith StockQuoteService has string as a paramter

In milestone 2 of module 6
it tells us to add StockQuoteService as a parameter
Modify the PortfolioManagerImpl constructor and PortfolioManagerFactory to accomodate StockQuoteService as a parameter.

But when I saw the unit test ,it was giving the string “tiingo” as a parameter and hence giving the error.

What shoud I do?

read the TODOs carefully there is a hint into it. I was also stucked there but after reading it twice I got the point.

1 Like

Hi @Suyash,

If you read the TODOs carefully, you’ll find why ‘tiingo’ is being supplied as a parameter. You need to return the service based on the supplied parameter to the factory object.

Also, as an added check, please test if your code is returning the right service when provider string is not passed. A lot of us faced an issue because of it.

Let me know if it helps!

1 Like

Yes, As per TODO’s it is right what you’re doing you also need check this class and hint is see the Factory method inside stock folder and apply your previous learning of factory method in this also think about some cases.

1 Like

Thank you @akashchhetri @shoryajain @deepadeshra for your suggestions.
Got over it.
Was confused with so many classes but with a little guidance from you guys cleared it.