I am trying to decouple existing code to be able to unit test it. I have introduced interfaces to remove the dependency on UI objects.The problem is that the Spring container's RegisterComponent < T > call requires a TComponentType parameter, so I cannot call RegisterComponent< IMyProgressBar > I have to call RegisterType < TMyProgressBar >.Implements < IMyProgressBar > which means I have to use the unit containing the progressbar class definition in DUnit which defeats the purpose of using the DIContainer in concert with the ServiceLocater to ask for a progressbar whenever I need one.
I don't want to have to create mock classes and implement the interfaces manually. Is there a way to use Delphi.Mocks to automatically mock an interface without specifying the implementing class?