1

I am using AWS C++ SDK to download/upload files on AWS using AWS::Transfer::TransferManager. I want to unit test client class which makes uses of TransferManager and It requires to mock TransferManager. The AWS TransferManager class is concrete class, not an abstract class. How do I mock it?

Quarra
  • 2,527
  • 1
  • 19
  • 27

1 Answers1

0

See this answer describing a technique called hi-perf dependency injection.

Basically it allows you to define dependency injection of non-virtual class at compile time (and not at runtime, as with regular depencendy injection) using templates. Downside is that you'll have to have it in the header file.

Quarra
  • 2,527
  • 1
  • 19
  • 27