TrackerManager implementation

Hi Peter,

I’ve started implementing the TrackerManager class (class TrackerManagerImpl : public TrackerManager), but I’ve ran into a problem with TrackerRequestSession/HttpRequestSession.

Since the TrackerManager needs to create a separate session for each tracker, I can’t passed a mocked HttpRequestSession to some member function and I’ve to create it privately in the TrackerManager implementation. But this is a problem because I can’t do it - real implementation must be without mocked classes.

So, my question is, how should I solve and implement this? I’d be grateful for any hints or references to the current code where a similar situation is solved.

Thanks in advance!

Petr

Would you like to post a relpy?


This post starts a thread.
Follow-ups:
Re: TrackerManager implementation
Hi Petr, One possible solution would be to pass a kind of session factory object to the ctor of TrackerManager. When testing you would pass a mocked factory that returns mock (more...)